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 write that has to happen twice (CDC and the outbox)

The Ledger Everyone Reads
The Ledger Everyone Reads · Open board

The book on the counter that many people read. That lesson stopped at one sentence about getting rows out of a database into the book. This one is that sentence, slowed down until it is a design.

Before you start. You need The Ledger Everyone Reads (event-driven & the log): a log is a book you only add to. Each reader keeps its own bookmark in it, called an offset. A reader can go back and replay what the book still holds. You need Charged Twice (idempotency & exactly-once): networks retry, so the same work can arrive twice. And you need The copy clerks (database replication): a database copies its changes to followers by sending them a stream of what it just did.

Lesson 26 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

  • 2012: LinkedIn has a database and a search index that disagree
  • The register and the carbon paper: why two writes cannot be made safe
  • The outbox: the slip written in the same stroke
  • Change data capture: reading the register’s own diary
  • The new reader problem: snapshot, then stream
  • The carrier crashes: the idempotent consumer

Terms it explains: dual write, outbox, change data capture, snapshot then stream, idempotent consumer.

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