← Back to microservices patterns mapdata
✂️
Microservices Pattern
CQRS
Separate write models from read models so each can optimize for its own workload.
Detailed Description
CQRS is useful when reads and writes have very different shapes or scale needs.
It often pairs with events so read models can be updated asynchronously.
Visual Diagram
Commands -> Write model Events/projector -> Read model Queries -> optimized read DB
Tradeoffs
Pros
Fast reads, independent scaling, clear write intent
Cons
More moving parts and eventual consistency
Examples: Event-sourced systems, denormalized read stores