title: Structure of a CQRS event store
body: <p>I'm currently trying to understand how to build the internal structure of an event store. What I got so far:</p>
  
  <ul>
  <li>An event store has two tables (collections, ...), one for aggregates and one for events.</li>
  <li>The aggregates table contains the following data: <code>aggregateId</code> (which will probably be a GUID) and the <code>aggregateVersion</code> (which is an integer that simply represents the number of the last event that influenced this aggregate).</li>
  <li>The events table contains the following data: <code>eventId</code> (again, a GUID), <code>aggregateId</code> (which the event belongs to), <code>payload</code>, and a <code>version</code> (which is simply an integer that describes the order of the events).</li>
  </ul>
  
  <p>Is this correct so far?
  Should events be ordered by using an integer? Or should they be ordered based on a timestamp? What are the advantages of each? What are the disadvantages?</p>