# CQRS

> Separate operations that read data from those that update data

- **Category**: Cloud
- **Subcategory**: azure
- **Canonical URL**: https://designpattern.fyi/patterns/azure_cqrs/

---

## Description
The CQRS (Command Query Responsibility Segregation) pattern separates operations that read data from those that update data by using distinct interfaces. This separation allows optimization for read and write operations independently. Read operations can use optimized views, while write operations ensure consistency through the command side.


## Use Cases
Use when read and write operations have different performance requirements or when complex queries need optimization separate from write operations.





## Trade-offs


### Advantages

- Optimized read and write performance

- Scalable read operations

- Separation of concerns

- Flexible data modeling




### Considerations & Drawbacks

- Increased complexity

- Data consistency challenges

- More code to maintain







---
**Reference**: [Original Source](https://learn.microsoft.com/en-us/azure/architecture/patterns/cqrs)

