Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Event Sourcing

3,786 views

Published on

Event Sourcing Tech Talk by Derek Comartin @ Windsor Hackforge

Published in: Technology, Business
  • Dating for everyone is here: ♥♥♥ http://bit.ly/39mQKz3 ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❶❶❶ http://bit.ly/39mQKz3 ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Event Sourcing

  1. 1. Event Sourcing @derek_comartin CodeOpinion.com
  2. 2. Agenda ● Typical Data Persistence ● Overview ● Events ● Why? ● Queries ● Drawbacks
  3. 3. Typical Data Persistence ● Maintain current state ● Concurrent users, data update conflicts. ● Auditing
  4. 4. Overview ● Old concept ● Using already (transaction log) ● Capture Intent ● Event = State Change ● Sequence of Events ● Append Only
  5. 5. Events ● Describes state change ● Past tense ● Source of truth ● Audit log
  6. 6. Event Stream Started Shopping Added T-Shirt Added Socks Removed Socks Added Coupon
  7. 7. Event StartedShopping { CartId: f5a7f55d-1e33-440c-836c-ea50fc59a274, CustomerId: f98902b3-e8cf-4b7a-b561-5e39a06b5e0c, Date: 2014-01-03 15:36:08, } AddedSocksToShoppingCart { CartId: f5a7f55d-1e33-440c-836c-ea50fc59a274, ProductId: ed00fa0b-6412-4cc6-bbac-14702bfeff3f, Quantity: 1, }
  8. 8. Why? ● Captures business intent ● Transaction & Audit log ● Build/Rebuild to any model ● Debugging ● Integration with other systems
  9. 9. Queries ● Generate Read Model from Events ● Secondary Data Source required ● Eventual Consistency Started Shopping Added T-Shirt Added Socks Removed Socks Added Coupon Any model you can think of! Cart Table CartId ProductId Quantity Denormalized Table CartId CustomerName ProductId Quantity Price
  10. 10. CQRS/ES Data Storage Domain Object Domain Object Command Handlers Client Command DTO Message Queue Read Layer Facade Query DTO Event Storage Events Message Queue Event Handlers Data Storage
  11. 11. Drawbacks ● Multiple Models / Data Sources ● Versioning ● Performance ● Maturity / Public Knowledge

×