CQRS
maang.io System Design Series
CQRS (Command Query Responsibility Segregation) splits a system's write path (commands) from its read path (queries), letting each scale and be modeled independently — writes handle complex domain logic, reads serve denormalized projections. Often paired with event sourcing, it's powerful but introduces an eventual-consistency gap between the two sides. Knowing when it's worth that complexity is the real skill.
This deep dive comes in three parts:
- Foundations & Core Concepts — separating commands from queries and read models.
- Internals — projections, pairing with event sourcing, and the consistency gap, with worked examples.
- Interview — Staff/Principal Q&A: when CQRS helps, when it's overkill, and handling staleness.