Continue where you left off ×
The cut phone line (CAP, done properly)
The Cut Phone Line · Open board
The law under The copy clerks (database replication) and Splitting the ledger (sharding) . Both left you holding copies that can disagree. This is the rule about what you may do when they do.
Before you start. The copy clerks gave you a second book that copies from the first and can fall behind by seconds. Splitting the ledger spread the stall’s records over more than one branch. That is the whole prerequisite: two places holding writing meant to say the same thing, and a wire between them.
The idea in 30 seconds
A partition is the network going quiet between your machines. It is weather, not a menu item.
During one, a machine facing a request has two moves: answer from what it has, or refuse until it can confirm.
Available means answering. Consistent means everyone sees the writes in the one order they happened, as though there were a single copy. CAP says you pick one during a partition and get both the rest of the time.
The choice is per operation, not per database. Add to cart can answer. Charge the card should refuse.
Nobody detects a partition. They time out and declare one, and that timeout is the real design decision.
A timeout that is too long turns someone else’s partition into your own outage, because all your threads end up waiting on silence.
Read the story
Lesson 7 of 115 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 .
See plans Already a member? Sign in
Or start free : a free account opens lessons 2 and 3 of every track.
In this lesson January 1996: a search engine that answered with whatever came back July 19, 2000: Brewer’s three words, and the one you do not get to pick The cut phone line: the two moves a lone clerk has She does not see a cut line. She hears silence. The five-second timeout that took down a shop with nothing wrong with it “CA” is not an option, it is a decision you have not made yet Terms it explains: partition, available, Consistency, CAP, AP, CP, timeout, linearizability, availability, Partition tolerance, drop arbitrarily many messages, 81 times, open, half-open, EL, EC, PA, PC, not linearizable, No message distinguishes them, 81×, backoff with jitter, retry budget, circuit breaker, consistency (linearizable), eventual consistency, PACELC, tunable consistency.
Review System Design
Mark as read Saved in this browser, and to your account when you sign in.