What is CQRS, when is it worth it, and when is it overkill?
Short answer
CQRS splits the write model (commands; constraints, transactions) from the read model (queries; data pre-shaped for screens), kept in sync via events or CDC. It pays off when reads and writes have very different needs; for plain CRUD it doubles the complexity.
3 points to say:
- Separate the write model (normalized, ACID) from the read model (denormalized, fast); event sourcing is not required.
- There are four levels, from separate classes on one DB to event sourcing; pick the lowest level that solves the problem.
- The cost: eventual consistency, syncing, debugging in two places; worth it when reads and writes are clearly lopsided, overkill for CRUD.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.