Repaso
Español
System DesignAdvancedSD-17

CQRS means…

Options

  1. Caching Queries Reduces Storage, a caching rule
  2. Separating the write model from the read model (Correct option)
  3. A query language used by relational databases
  4. 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.

Key terms

Practice this question in Repaso