Let’s Learn Together<br />Intro to CQRS<br />Ted M. Young  @jitterted<br />Developer & Agile Coach<br />Guidewire Software...
What’s the Problem<br />CAP<br />Consistency<br />Availability<br />Partitionability<br />
Can’t Have All Three<br />CAP: Choose Two<br />Consistency + Availability<br />Sacrifice Partitionability<br />E.g., singl...
BASE vs. ACID<br />Basically Available<br />Soft-state<br />Eventual consistency<br />Stale data is OK<br />
What’s so bad about<br />Eventual Consistency<br />
BASE is Not New<br />Inktomi Presentation in 1998<br />
Not an either-or, but a spectrum<br />BASE vs. ACID<br />
CQRS<br />Leans to BASE<br />
CQRS is<br />Command Query Responsibility Segregation<br />
http://www.udidahan.com/2009/12/09/clarified-cqrs/<br />
Command<br />Mutator<br />
Re-think UI<br />No more CRUD?<br />Stop The Forms<br />
Query<br />With respect to the queried data<br />Read-Only<br />
Resources: CAP, Other Background<br />Bertrand Meyer<br />Command-Query Separation, §23.1 (p. 751)<br />Object-Oriented So...
Resources: CQRS-Specific<br />Greg Young (no relation)<br />CQRS and CAP<br />http://codebetter.com/gregyoung/2010/02/20/c...
Resources: CQRS-Specific<br />RinatAbdullin<br />CQRS Starting Page<br />http://abdullin.com/cqrs/<br />More useful info f...
Thanks!<br />Follow me on Twitter: @jitterted<br />Email me: tyoung@guidewire.com<br />[Guidewire is hiring devs and teste...
Upcoming SlideShare
Loading in …5
×

Intro to CQRS

1,866 views

Published on

My (minimal) slides from the presentation I gave a

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,866
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
41
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Intro to CQRS

  1. 1. Let’s Learn Together<br />Intro to CQRS<br />Ted M. Young @jitterted<br />Developer & Agile Coach<br />Guidewire Software, San Mateo, CA<br />Silicon Valley Code Camp – October 9, 2011<br />Creative Commons Attribution-ShareAlike (CC BY-SA 3.0)<br />
  2. 2. What’s the Problem<br />CAP<br />Consistency<br />Availability<br />Partitionability<br />
  3. 3. Can’t Have All Three<br />CAP: Choose Two<br />Consistency + Availability<br />Sacrifice Partitionability<br />E.g., single database, clustered database<br />Consistency + Partitionability<br />Sacrifice Availability<br />E.g., pessimistic locking, distributed locking<br />Availability + Partitionability<br />Sacrifice Consistency<br />E.g., optimistic locking, merging, expirations<br />Many systems are like this: eventually consistent<br />Whether you like it or not<br />
  4. 4. BASE vs. ACID<br />Basically Available<br />Soft-state<br />Eventual consistency<br />Stale data is OK<br />
  5. 5. What’s so bad about<br />Eventual Consistency<br />
  6. 6. BASE is Not New<br />Inktomi Presentation in 1998<br />
  7. 7. Not an either-or, but a spectrum<br />BASE vs. ACID<br />
  8. 8. CQRS<br />Leans to BASE<br />
  9. 9. CQRS is<br />Command Query Responsibility Segregation<br />
  10. 10.
  11. 11. http://www.udidahan.com/2009/12/09/clarified-cqrs/<br />
  12. 12. Command<br />Mutator<br />
  13. 13. Re-think UI<br />No more CRUD?<br />Stop The Forms<br />
  14. 14. Query<br />With respect to the queried data<br />Read-Only<br />
  15. 15. Resources: CAP, Other Background<br />Bertrand Meyer<br />Command-Query Separation, §23.1 (p. 751)<br />Object-Oriented Software Construction, 2nd Ed. (ISBN 0136291554)<br />Dr. Eric Brewer, Inktomi<br />Presentation (1998)<br />http://www09.sigmod.org/disc/disc99/disc/nsf_acad_ind/brewer/sld019.htm<br />Dan Pritchett<br />BASE and latency<br />http://www.infoq.com/articles/pritchett-latency<br />Prevayler<br />http://prevayler.org/old_wiki/Welcome.html<br />
  16. 16. Resources: CQRS-Specific<br />Greg Young (no relation)<br />CQRS and CAP<br />http://codebetter.com/gregyoung/2010/02/20/cqrs-and-cap-theorem/<br />UdiDahan<br />Good overview<br />http://www.udidahan.com/2009/12/09/clarified-cqrs/<br />Martin Fowler’s CQRS<br />http://martinfowler.com/bliki/CQRS.html<br />Axon Framework (Java)<br />http://www.axonframework.org<br />
  17. 17. Resources: CQRS-Specific<br />RinatAbdullin<br />CQRS Starting Page<br />http://abdullin.com/cqrs/<br />More useful info from Rinat with good PDF diagram<br />http://abdullin.com/xlim/<br />PålFossmo<br />Another nice blog entry on CQRS<br />http://blog.fossmo.net/post/Command-and-Query-Responsibility-Segregation-%28CQRS%29.aspx<br />
  18. 18. Thanks!<br />Follow me on Twitter: @jitterted<br />Email me: tyoung@guidewire.com<br />[Guidewire is hiring devs and testers!]<br />Final Questions?<br />

×