From the course: Microservices: Design Patterns
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Command Query Responsibility Segregation
From the course: Microservices: Design Patterns
Command Query Responsibility Segregation
- Of all the data patterns for microservices we will discuss in this course, the command query responsibility segregation pattern is by far the most complex of them all. CQRS is one of the most ethereal concepts of data management. Those that get it well and can implement it successfully can dramatically improve their data behavior across the system as a whole. The core pattern we are trying to solve is that our data access patterns diverge from traditional CRUD to a more complex, multi-model pattern within a single bounded context or data domain. This becomes more clear as we have multiple interfaces. In a CQRS model, query interfaces may transform and aggregate the schema to represent the model in a very specific use. However, the write interfaces may inject behavior and infer characteristics based on an entirely different model and set of rules, but the underlying data becomes the same through eventual consistency. Now, obviously this is a very clear divergence from CRUD where a…