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

Event Sourcing: The Best Ubiquitous Pattern You...

Event Sourcing: The Best Ubiquitous Pattern You've Never Heard Of

Event Sourcing is powerful way to think about domain objects and transaction processing. Rather than persisting an object in it's current state, event sourcing instead writes an immutable log of deltas (domain events) to the database. from this set of events, an object's state is derived, at any point in the past, simply by replaying the event history sequentially. Event sourcing is a deceptively radical idea which challenges our contemporary notions about transaction processing, while also being a mature pattern with a long history. This talk will take a look at how event processing is used across a spectrum of use cases, including database engines and financial systems.

Avatar for Bryan Reinero

Bryan Reinero

June 20, 2015

Other Decks in Technology

Transcript

  1. Event  Sourcing   The  best  ubiquitous  pa5ern  you’ve  never  heard

     of.     {  Name:  ‘Bryan  Reinero’,   Title:  ‘Developer  Advocate’,   Twi5er:  ‘@blimpyacht’,   Email:  ‘[email protected]’  }  
  2. Let’s  Build  a  Banking  App   User: A Balance: 427

    User: B Balance: 550 +5   -­‐5  
  3. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   State  at  t(12)  =  9   Event  Sourcing  
  4. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   State  at  t(5)  =  10   Event  Sourcing  
  5. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   State  at  t(9)=  12   Event  Sourcing  
  6. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   Event  Sourcing   +5   -­‐4   +5  
  7. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   Event  Sourcing  
  8. +4   -­‐2   +5   +7   -­‐4  

    +9   -­‐3   -­‐6   +2   +1   +1   -­‐5   State  at  t(4)  =  14   Event  Sourcing   State  at  t(8)  =  10   State  at  t(12)  =  9  
  9. CRUD  vs.  CQRS   U.I.   2ndary   WRITE  

    READ   2ndary   Primary   READ  
  10. CRUD  vs.  CQRS   U.I.   2ndary   WRITE  

    READ   2ndary   Primary   READ