Command Query Responsibility Segregation (CQRS)
Explore the Command Query Responsibility Segregation (CQRS) pattern and how it separates read and write paths to optimize large-scale distributed systems. Learn the benefits of independent scaling, improved query efficiency using materialized views, and eventual consistency considerations. This lesson helps you understand when and how to implement CQRS and highlights its trade-offs in system complexity and performance.
We'll cover the following...
In this last lesson of the chapter, we will discuss a popular architectural pattern for distributed systems: the command query responsibility segregation (CQRS) pattern.
What is CQRS?
The name pretty much gives away the meaning.
In CQRS, read and write paths are separated, and possibly there are separate databases that handle read and write requests.
Command means requests like create, insert, update or delete. On the other hand, query means read requests. In read requests, no data is changed in any way. Data is served to clients as a response to queries. In CQRS, the read and the write path are segregated. Written data is made available for ...
In the diagram above, we can see a high level overview of the CQRS pattern. Here: ...