CQRS Resources

I’ve spent the last couple of weeks studying Command Query Responsibility Segregation (CQRS). I found that information is scattered all over the internet and that at the moment there isn’t a single authoritative resource yet, this slows studying CQRS down somewhat. In this post, I’ll summarize the resources I found useful.

I’ll first introduce some people and then list some good starting points, depending on your needs.

People in CQRS

A short who-is-who in CQRS. I’ll probably forget some important people … sorry for that.

Greg Young is credited for coining the term Command Query Responsibility Segregation. Rumors are that he’s working on a book; but is isn’t nearly finished yet, a compilation of samples is available though [8]. He has written many blog posts on CQRS [7] and has given many talks - many available on the net. Saying he’s an authoritative resource on the subject is an understatement.

Udi Dahan started the NServiceBus project and the NServiceBus Ltd company. He has advocated the use of CQRS principles in distributed applications and found that it was a good match with the use of an enterprise service bus such as NServiceBus. His article “Clarified CQRS” [9] is referenced a lot.

Rinat Abdullin is a driving force behind Lokad.CQRS [3] and the CQRS pocket guide [2]. His blog [1] is a good read too.

Eric Evans’ big blue book [4] on domain driven design is a must-read. Vernon Vaughn is writing a book on implementing domain driven design [10], but is is not yet published. Mark Nijhoff created a comprehensive and complete CQRS reference application in .net. It is available on Github and is documented on his blog [11]. Jonathan Oliver [6] created the EventStore [5] framework for .net and is also a contributor to Autofac and NServiceBus.

Starting points

I can recommend the following starting points:

If you want to study a working example:

If you’ve got some time and want to watch a video:

The last video is almost 7 hours long, but it is AWESOME and worth every minute of your time if you’re seriously considering applying CQRS to one of your projects.

Code - examples & frameworks

The basic principles for doing CQRS are pretty straightforward and do not require the use of advanced frameworks.

Using a framework for event sourcing (persisting domain state using events) might be useful. For all other things, you are probably best of rolling your own infrastructure, which should not be more then several hundreds lines of code.

Examples