CQRS
Command Query Responsibility Segregation is about to create two separate models, one for update (write) and one for query (read). In fact there can be more than one model also known as view. From DDD perspective a view can span multiple aggregates especially in complex domain model.
The main motivations for CQRS:
- Scalability (scaling each part separately)
- Flexibility
- Reducing complexity (tailored query model)
- Optimization
The CQRS is also related to Microservice architecture where each service maintains data in dedicated data store and it is not possible to do execute cross service query. The view model is driven by data consumer.
