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

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

System DesignDistributed transactions: two-phase commit

The two ledgers must agree

₹100 leaves Alice's shard and has to arrive on Bob's. Something dies in the middle. Where does the money end up?

Two account books live on separate machines, and one transfer has to touch both. The panels walk the protocol step by step, show what each book holds at this moment, and print the verdict: money safe, money stuck, or money gone. Move the crash to a different step and the verdict moves with it.

Included with a plan

This lab is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

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

the lesson The Two Ledgers Must Agree (Distributed Transactions)
The whole idea this lab came from, told start to finish.

on the path Module 2 of 32 in System Design: When the stalls must agree
The lessons, boards and videos around this lab, in reading order.

Board: The Two Ledgers Must Agree

see also In Search of an Understandable Consensus Algorithm, Spanner: Google's Globally-Distributed Database, Time, Clocks, and the Ordering of Events in a Distributed System, Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services, Paxos Made Simple and Large-scale Incremental Processing Using Distributed Transactions and Notifications in Papers.