Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is CQRS?

Batch & Streaming · Streaming Processing

What is CQRS?

Mediumstream-24
CQRSreadswritesprojections

Question

What is CQRS, and why do data platforms care?

Solution

CQRS means Command Query Responsibility Segregation: write models (commands that change state) are separated from read models (queries optimized for serving).

Instead of one schema trying to be perfect for both writes and analytics, you accept two shapes of data, kept in sync via events or projections.

Commands (writes)              Queries (reads)
  POST /orders                   GET /orders/summary
       |                              ^
       v                              |
  write DB / event store ----project--> read DB / warehouse / cache

Why DEs hear this

  • OLTP app keeps normalized tables for writes
  • Analytics needs denormalized facts/dims
  • Kafka events or CDC project app writes into warehouse tables

Interview tip: "Writes and reads use different models; events/CDC sync them." Not every app needs full CQRS jargon. Many warehouses are already a read side.

PreviousNext