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.
Preparing for interviews? The ten-week plan puts this in order with DSA and the design rounds.
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.
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.