Editorials

An Easier Way to Learn CQRS

I have written a number of times about the CQRS pattern for communication of data in computer applications. CQRS stands for Command Query Response Segregation. This pattern is based on the theory that a system usually has higher read activity than create/update/delete activity. The create/update/delete activity is considered a command. The read activity is considered a response. So, the pattern separates the reads from the writes.

Today I found an excellent white paper on CQRS at Microsoft.com at https://www.microsoft.com/en-us/download/details.aspx?id=34774. The title is Exploring CQRS and Event Source. It is available in print or download.

I really like the format used for this document. The paper is based on a fictional company with a fictional project. That’s where the fiction ends. They build a real/working application to create conferences, register attendees, receive payment, etc. They provide a sort of role playing history, explaining the activity as a sort of story. Real people played real roles, and did the real work. What’s really helpful are comments made by individuals allowing you to see how the whole thing comes together from different perspectives.

They actually built this application to demonstrate that it can be done. They actually did the project in phases, much like a real company would build software. The core systems are generated first, and included in this document. Then other features are later added in, and are included in an ongoing web site, also found at the above link. A link is also provided for the source code generated in this project.

If you are new to the CQRS pattern, or simply want to build on the experience of others, this is a fantastic way to gain knowledge. It demonstrates what business requirements cause them to consider the CQRS pattern in the first place, areas where they chose not to use the pattern, ways to organize and communicate your design, and different solutions you may consider.

Cheers,

Ben