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.

Introduction to cqrs

934 views

Published on

Slides from Code Mastery meetup 22 Mar 2017

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction to cqrs

  1. 1. CQRS EXPLAINED DARIUSZ SADOWSKI (@DARSADOW)
  2. 2. AT THE BEGINNING THERE WAS CRUD
  3. 3. STATE IS EVERYTHING
  4. 4. COMMAND-QUERY SEPARATION
  5. 5. COMMAND
  6. 6. QUERY
  7. 7. FIRST STEP INTO BETTER WORLD
  8. 8. REAL WORLD
  9. 9. IN PRACTICE ▸Command as a Request ▸Command Handler ▸Response is optional ▸… but it can be very helpful ▸State is still your main concern
  10. 10. STATE CHANGE ONLY IN COMMAND HANDLER
  11. 11. COMMAND REFLECTS ONE INTERACTION WITH THE SYSTEM
  12. 12. WHEN INTERACTION CHANGES ONLY ONE HANDLER NEEDS TO CHANGE
  13. 13. WHO CARES ABOUT QUERIES?!
  14. 14. LETS ADD THE MISSING “R”
  15. 15. SEPARATION ON DEEPER LEVEL
  16. 16. WRITE MODEL
  17. 17. READ MODEL
  18. 18. BUT WHY?
  19. 19. WHY TO SEPARATE READ MODEL? ▸Prepare data for many different views ▸Transformation at write to keep data readable ▸Integration with other systems ▸Performance
  20. 20. LETS TALK ABOUT WHAT HAPPENED
  21. 21. EVENT IS A DESCRIPTION OF THE FACT OF THE PAST
  22. 22. COMMAND IS A COMMAND ;)
  23. 23. FROM COMMAND TO THE EVENT
  24. 24. EVENT CAN BE ADDED BUT CAN’T BE MODIFIED
  25. 25. MATERIALISED VIEWS
  26. 26. WHEN YOU KNOW WHAT HAPPENED YOU CAN DO QUITE A LOT WITH IT
  27. 27. TEXT {GOOD THINGS} ABOUT EVENT SOURCING ▸Replay-ability ▸Undo ▸Audit trail ▸Reactive system modelling
  28. 28. DOWNSIDES OF CQRS/ES
  29. 29. SUMMARY
  30. 30. THANK YOU

×