~/notes/cqrs

CQRS (Command Query Responsibility Segregation)

CQRS separates the model used to change state from the model used to answer queries.

Aug 20, 2026

diagram
commandasynchronous updatequeryview

User

Command Model

Write Store

Projection Handler

Read Store

Query Model

commandasynchronous updatequeryview

User

Command Model

Write Store

Projection Handler

Read Store

Query Model

Pros

  • We can design models that handle business rules, while separate read models are optimised for queries.
  • This approach lets command and query workloads scale independently when needed.
  • It supports creating different projections for various users or use cases.

Drawbacks

  • You will need to manage duplicate models, extra mapping, and more components.
  • Asynchronous projections can cause delays and need clear handling for stale reads.
  • Using CQRS for basic CRUD systems adds extra complexity without much advantage.