Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CQRS & Event Sourcing in OLX

CQRS & Event Sourcing in OLX

Łukasz Szymański

May 16, 2016
Tweet

More Decks by Łukasz Szymański

Other Decks in Programming

Transcript

  1. you can use a different model to update information than

    the model you use to read information http://martinfowler.com/bliki/CQRS.html „
  2. Not just can we query these events, we can also

    use the event log to reconstruct past states http://www.martinfowler.com/eaaDev/EventSourcing.html „
  3. Commad Event Model Event Storage Event Bus Command Handler Listeners

    Read Storage Read Model Query Critical section - use transaction
  4. Commad Event Model Event Storage Event Bus Command Handler Listeners

    Read Storage Read Model Query Critical section - use transaction Treat like temporary cache
  5. Wallet Credits Bonus Credits Refund Credits EXPIRE: X DAYS EXPIRE:

    X DAYS EXPIRE: X DAYS INVOICE: YES/NO INVOICE: YES/NO INVOICE: YES/NO
  6. Wallet Credits Bonus Credits Refund Credits EXPIRE: NEVER EXPIRE: 90

    DAYS EXPIRE: 90 DAYS INVOICE: YES INVOICE: NO INVOICE: YES
  7. EventHandling provides interfaces for an event bus and event listeners,

    but also an implementation of a simple event bus and an event bus that will record published events
  8. EventSourcing Provides base classes for event sourced aggregate roots and

    entities, an event sourced repository implementation and testing helpers.
  9. EventStore implementation based on doctrine/dbal to store events in a

    relational database and an in-memory implementation that is useful for using in tests
  10. ReadModel provides storage for your read models, a projector implementation

    to create read models from event streams and testing helpers.
  11. Commad Event Model Event Storage Event Bus Command Handler Listeners

    Read Storage Read Model Query Critical section - use transaction