CQRS means…
Options
- Caching Queries Reduces Storage, a caching rule
- Separating the write model from the read model (Correct option)
- A query language used by relational databases
- A consensus algorithm for distributed nodes
Answer
Separating the write model (commands) from the read model (queries), often with different data stores
Why
Command Query Responsibility Segregation: use one model to change data (commands, with all validation) and a different model, shaped for fast reading, to query it.
Example: orders are written to PostgreSQL; an event updates a denormalized search index used by the order list page.
The read side may be a little behind (eventual consistency). It adds complexity, so use it only when reads and writes really differ.
Remember
CQRS = separate models for writing and reading.