Application Architecture

Module 6

CQRS

Separating the model you write through from the model you read through: a spectrum of four levels, what each one buys, and why the top of it is rarely justified.

32 min2 lessons
Start module

What you will be able to do

  • Separate CQRS from event sourcing and from having two databases.
  • Place a system on the CQRS spectrum and justify moving one step.
  • Explain the consistency consequences of a separate read store.
  • Design a read model shaped by screens rather than by the write model.
  • Recognise where CQRS adds cost without buying anything.
  1. 01CQRS Is a Spectrum, Not a Switch

    At its simplest CQRS is two sets of types in one codebase. At its most elaborate it is two stores kept in sync asynchronously. Most of the value is available near the bottom.

  2. 02Read Models, Staleness, and the Cost of Level 4

    Once the read store is updated asynchronously, you have accepted eventual consistency. That is a product decision before it is a technical one, and it needs designing rather than discovering.

CQRS

6 questions · pass at 75%