> [!abstract] Command Query Responsibility Segregation - separating the write (command) side of a system from the read (query) side as independently deployable systems.
## How It Works
- **Command side**: handles writes and mutations, owns the source of truth database
- **Query side**: maintains an optimized read model, updated by consuming events
## When to Use
- Writes have complex business logic
- Queries need to be very fast
- Read and write patterns are very different
## Caution
A challenging pattern - don't use it everywhere. Only apply when the complexity is justified.
## Related
- [[Event Driven Architecture]]
- [[Eventual Consistency]]
## Sources
[[x_Sources/Videos/Video - Build An Event Driven System - NDC Oslo 2024|Build An Event Driven System - James Eastham (NDC Oslo 2024)]]