CQRS
Separate models for writing and reading, each optimised for its job.
4 to work through
-
advanced
A classifieds and auction marketplace at eBay's listing volume runs CQRS - writes to Postgres and a search-shaped read model built from an append-only change log that now holds 1.2 billion events across 24 partitions. A projection bug has been live for nine days. Work out roughly how long a full rebuild takes and say what that number decides.
3 min answer -
advanced
A live platform's read requirements differ sharply from its write model. What evidence justifies CQRS, and what obligation does it create?
2 min answer -
advanced
A team proposes CQRS with event sourcing for a new internal admin tool because the patterns are considered scalable. Evaluate.
3 min answer -
advanced
A team proposes CQRS with event sourcing for a new service. How do you evaluate the proposal?
2 min answer
3 terms in this topic
CQRS
Separating the model that accepts writes from the model that serves reads, so each can be optimised independently — at the cost of the gap between them.
metricProjection Rebuild Budget
The measured wall-clock time to rebuild a read model from scratch, treated as a service level objective, because it bounds how quickly a projection d…
patternRead Model Projection
A denormalised store built and maintained from write-side events specifically to serve one query shape efficiently.
Neighbouring topics
Architecture Patterns
General material on architectural patterns and their trade-offs.
Layered Architecture
The default shape, its clarity, and where a technical partition fails.
Event-Driven Architecture
Publishing facts, and trading comprehensibility for decoupling.
Pipes and Filters
Independent transformation steps composed into a pipeline.
Publish/Subscribe
Broadcast to every subscriber, as distinct from work distribution.
Competing Consumers
Scaling throughput with instances, at the cost of ordering.
Saga
Local transactions with compensating actions across services.
Event Sourcing
The event log as the system of record, with state as a projection.
Outbox
Making the event atomic with the business write it describes.
Strangler Fig
Incremental replacement behind a routing facade.
Anti-Corruption Layer
Translating a foreign model at the boundary so it does not leak in.
Sidecar & Ambassador
Cross-cutting behaviour in a co-deployed process.
Service Mesh
Sidecars applied estate-wide, and the scale at which that pays.
API Gateway
A single entry point for policy, routing and protocol translation.
Backend for Frontend
A narrow backend per client experience, owned by that client's team.
Cell-Based Architecture
Complete isolated copies each serving a subset of customers.
Sharding Patterns
Directory versus embedded keys, logical shards and rebalancing.
Materialized Views
Precomputed query results, refreshed incrementally or in full.
Orchestration vs Choreography
A coordinator that knows the flow, or services that react to events.