Glossary

CQRS

CQRS (Command Query Responsibility Segregation) is a pattern that separates read and write models. Commands change state; Queries read it. They use different models and sometimes different data stores.

Why

Reads and writes have different requirements: queries involve complex JOINs and aggregations; commands require transactional integrity. Separating them allows each to be optimised independently.

Simple CQRS

One database, but separate classes: CreateOrderCommand and OrderSummaryQuery. Minimal complexity, but already provides structure.

Full CQRS with Event Sourcing

The write side stores events (Event Store); the read side builds denormalised projections suited for reading. High complexity, but full audit trail and the ability to "replay" state.

Caveat

CQRS adds complexity. Justified in complex domains with different read/write loads. Unnecessary for CRUD applications.