All glossary terms
Design

CQRS

Command Query Responsibility Segregation is an architectural pattern that splits a system's write path (commands that change state) from its read path (queries that return state) — typically with separate models, sometimes separate databases. CQRS scales reads and writes independently and lets each side be optimised for its workload.

CQRS was named by Greg Young around 2010, extending Bertrand Meyer's command-query separation principle from object design to system architecture. It pays off when read patterns and write patterns diverge sharply — e.g., a write model needs strong consistency and complex validation while reads need denormalised, queryable projections. CQRS often (not always) pairs with event sourcing: the write side appends events, projectors build read models. Anti-pattern: applying CQRS to a CRUD system that has neither read-write divergence nor scale — you pay the complexity cost without the benefit. Common rule of thumb: introduce CQRS at the service or bounded-context level, not system-wide.

Related terms