Upload
ted-young
View
1.260
Download
1
Embed Size (px)
DESCRIPTION
My (minimal) slides from the presentation I gave a
Citation preview
Let’s Learn Together
Ted M. Young @jittertedDeveloper & Agile Coach
Guidewire Software, San Mateo, CA
Intro to CQRS
Silicon Valley Code Camp – October 9, 2011
Creative Commons Attribution-ShareAlike (CC BY-SA 3.0)
What’s the Problem
CAPConsistencyAvailabilityPartitionability
Can’t Have All Three
CAP: Choose TwoConsistency + Availability
Sacrifice PartitionabilityE.g., single database, clustered database
Consistency + PartitionabilitySacrifice AvailabilityE.g., pessimistic locking, distributed locking
Availability + PartitionabilitySacrifice ConsistencyE.g., optimistic locking, merging, expirationsMany systems are like this: eventually consistent
Whether you like it or not
BASE vs. ACID
Basically AvailableSoft-stateEventual consistency
Stale data is OK
What’s so bad about
Eventual Consistency
BASE is Not New
Inktomi Presentation in 1998
Not an either-or, but a spectrum
BASE vs. ACID
CQRS
Leans to BASE
CQRS is
Command Query Responsibility Segregation
http://www.udidahan.com/2009/12/09/clarified-cqrs/
Command
Mutator
Re-think UI
No more CRUD?
Stop The Forms
Query
With respect to the queried data
Read-Only
Resources: CAP, Other BackgroundBertrand Meyer
Command-Query Separation, §23.1 (p. 751)Object-Oriented Software Construction, 2nd Ed. (ISBN 0136291554)
Dr. Eric Brewer, InktomiPresentation (1998)
http://www09.sigmod.org/disc/disc99/disc/nsf_acad_ind/brewer/sld019.htm
Dan PritchettBASE and latency
http://www.infoq.com/articles/pritchett-latency
Prevaylerhttp://prevayler.org/old_wiki/Welcome.html
Resources: CQRS-Specific
Greg Young (no relation)
CQRS and CAPhttp://codebetter.com/gregyoung/2010/02/20/cqrs-and-cap-theorem/
Udi DahanGood overview
http://www.udidahan.com/2009/12/09/clarified-cqrs/
Martin Fowler’s CQRShttp://martinfowler.com/bliki/CQRS.html
Axon Framework (Java)http://www.axonframework.org
Resources: CQRS-Specific
Rinat AbdullinCQRS Starting Page
http://abdullin.com/cqrs/More useful info from Rinat with good PDF diagram
http://abdullin.com/xlim/
Pål FossmoAnother nice blog entry on CQRS
http://blog.fossmo.net/post/Command-and-Query-Responsibility-Segregation-%28CQRS%29.aspx
Thanks!
Follow me on Twitter: @jittertedEmail me: [email protected]
[Guidewire is hiring devs and testers!]
Final Questions?