title: How to persist event log data in database?
body: <p>In my application I have a strong requirement for logging each event for the entity and I was considering using <a href="http://www.martinfowler.com/eaaDev/EventSourcing.html" rel="nofollow noreferrer">event sourcing</a> pattern, i.e. all domain changes have explicit classes and any change to the domain objects can go only using these event classes. You can then rollback and reapply these changes as you want, just like in source control system.</p>
  
  <p>This would solve many issues for me, but I do no know how to persist event objects to db. I will probably have hundreds of event types, so I have limited options:</p>
  
  <ul>
  <li>build a table for each event type (hundreds of tables? what about references to entities?)</li>
  <li>build a huge table for all events (with thousands of columns?)</li>
  <li>somehow store a binary representation of event in db (??)</li>
  <li>store it in some separate file (??)</li>
  </ul>
  
  <p>Do you have any ideas how this can be done?</p>