Successfully reported this slideshow.

Command and Query Responsibility Segregation

1,284 views

Published on

Short introduction to Command and Query Responsibility Segregation architectural pattern

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Command and Query Responsibility Segregation

  1. 1. Command-Query Responsibility Segregation Ürgo Ringo
  2. 2. “ Separate command methods that change state from query methods that read state.” – Bertrand Mayer
  3. 3. ACID <ul><li>Atomicity
  4. 4. Consistency
  5. 5. Isolation
  6. 6. Durability </li></ul>
  7. 7. CAP <ul><li>Consistency
  8. 8. Availability
  9. 9. Partition Tolerance </li></ul>
  10. 10. BASE <ul><li>Basically Available
  11. 11. Soft State
  12. 12. Eventually Consistent </li></ul>For example: Google, Yahoo, Facebook, Amazon, eBay, etc
  13. 13. Architecture overview
  14. 14. Benefits <ul><li>No ORM mapping needed when viewing stuff
  15. 15. No DTO -> Domain transformation
  16. 16. Can cache view data
  17. 17. Domain model can be encapsulated
  18. 18. View data can be stored in non-relational DB
  19. 19. Helps to solve problems related to having ACID
  20. 20. Domain model can be simpler </li></ul>
  21. 21. References <ul><li>http://highscalability.com/blog/2009/5/5/drop-acid-and-think-about-data.html
  22. 22. http://www.udidahan.com/2009/12/09/clarified-cqrs/
  23. 23. http://codebetter.com/blogs/gregyoung/archive/2009/08/13/command-query-separation.aspx
  24. 24. http://www.infoq.com/presentations/greg-young-unshackle-qcon08 </li></ul>

×