Distributed

Lesson 03.12

CQRS & event sourcing

Event sourcing stores every change as an event in an append-only log, and CQRS builds separate read models from that log for fast queries.

The book is the truth

The shop keeps a money book 📒: every coin in or out is a new line, and old lines are never changed. A screen shows the total, worked out from the book by Ben.

One day the screen breaks. The book is fine. How does Ben get the total back?

In this lesson you'll

  1. 1Watch Ben add up the whole book again.
  2. 2Guess how saved totals change that.
  3. 3Get the total back quickly.