title: EventSourcing and DDD Entity events
body: <p>I have a DDD project using EventSourcing. And currently there are many aggregate roots many of which have collections of entities. Even more - some entities have collections of other entities.</p>
  
  <p>Problem: Reading EventSourcing event log for audit purposes.</p>
  
  <p>Question: What is the best way to save events in EventStore when an entity is Updated/Created/Removed having all these things in mind: they have to be easily readable, versions, may be not for this case but usually granular events are preferable, probably domain-events are going to be used for cross domain communication. </p>
  
  <ol>
  <li><p>Should I save in the root stream the whole root with all collections of entities inside as a RootChangedEvent ?</p></li>
  <li><p>Should I save only the entity which was Updated/Created/Removed in the root stream as a EntityChangedEvent/EntityCreatedEvent/EntityRemovedEvent</p></li>
  <li><p>Should I save in the root stream Two events - one for the root - RootChangedEvent with only the version property + second for the entity which will have only a single property if such changed in EntityChangedEvent or whole entity if EntityCreatedEvent or only id if EntityRemovedEvent (How to handle if entity of entity created/updated/removed?)</p></li>
  </ol>
  
  <p>Here is an example in my project:</p>
  
  <p>The root - Pipeline. </p>
  
  <pre><code>public class Pipeline : AggregateRoot&lt;IPipelineState&gt;
  </code></pre>
  
  <p>It has collection of entities - <code>public IList&lt;Status&gt; Statuses</code>.</p>
  
  <p>And each Status has collection of entities - <code>public IList&lt;Logic&gt; Logics</code>.</p>
  
  <p>All collections could store a lot of entities. And right now I raise events like PipelineCreatedEvent, PipelineChangedEvent (not only when Pipeline changed but even when adding, updating, removing Status or Logic) and PipelineRemovedEvent.</p>