Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

Launch price

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansStart free instead

Module 05 · System Design · Deeper than the interview

Watch: Event-driven architecture: the ledger everyone reads
▶ Video

The log is the truth (event sourcing and CQRS)

The Ledger Everyone Reads
The Ledger Everyone Reads · Open board

The book on the counter that nobody may erase. That lesson used the book to tell many readers what happened. This one goes a step further and asks what happens if the book is not a copy of the truth but the truth itself.

Before you start. You need The Ledger Everyone Reads (event-driven & the log): a log is a book you only add to, and any reader can read it from the top. You need Charged Twice (idempotency & exactly-once): the same message can arrive twice, so a reader must cope with repeats. And the sibling lesson The write that has to happen twice (CDC and the outbox) showed how to get changes out of a database into such a book. Here the book comes first and the database is built from it.

Lesson 29 of 73 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year, or $19.50 for your first year with LAUNCH50, ends 1 Nov, 18:30 UTC.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1494: a Venetian merchant who may not use an eraser
  • Most software keeps the number and throws away the story
  • 2005: Fowler writes down the habit, and names the lines events
  • Replay: the balance is the lines added up
  • The projection: a view you can throw away
  • CQRS: writing and reading become two different jobs
  • What it costs

Terms it explains: event, event store, replay, projection, CQRS, command, query, snapshot.

Lab

The same answer is correct under one promise and a violation under another. Which promise did you make?

Drag Moments the boards run behind the ledger to 3, press Play next moment through the evening, and watch promises broken.

Open The ledger everyone reads

Every sale goes in the register and must also reach the warehouse. The app crashes now and then. Which design lets the two disagree?

Drag How often the app crashes, then switch the tab to Write once, copy from the diary, and watch Do the two agree.

Open The write that happened twice

Related papers

Review System Design