When part of a distributed system is cut off from the rest by a network failure, what should it do when asked a question? Should it answer immediately from its own copy of the data and risk giving an outdated reply, or refuse to answer until communication is restored? Can any system ever guarantee both immediate answers and up-to-date consistency?
To find out, we follow the four Greek mercenaries at the foot of Mount Phyle on a night when hunting hawks intercept their ravens, cutting one tent off from the others while they try to keep track of their shared battle plan.
To find out, we follow the argument step by step. A replicated service keeps its data on four machines, and a network failure cuts one of them off from the others just as a client asks it a question.
After Eric A. Brewer, Towards Robust Distributed Systems, 2000 · Seth Gilbert and Nancy Lynch, Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services, 2002

Each link traces how one paper built upon another. Hover over or tap any link to see the connection.
a paper this book retells a paper retold in another book a paper outside the series
Four mercenaries are camped at the foot of Mount Phyle, one to a tent, hidden from one another by the folds of the hillside.* Bandits hold the summit above them, and the four keep in touch across the gullies only by messenger raven.Four nodes, P1 to P4, each hold a copy of one shared piece of data. They keep in touch only by messages over a network that may lose some of them.
Throughout the night, the four mercenaries keep a standing plan, the current choice (attack or hold) that they intend to follow when the time comes. At dusk, the standing plan starts at hold.Throughout the execution, the four nodes keep a shared value, either 1 or 0. At the start, the shared value is 0.
As the night wears on, any mercenary who spots movement on their side of the mountain may move (write) the standing plan to the opposite answer, and at any time any mercenary may ask (read) which plan currently stands. Each tent keeps its own written note of the plan. A move is complete once the mercenary who made it is told that their change stands; a question is complete once the mercenary who asked is given an answer of attack or hold.As the execution goes on, any node may write the opposite value, and at any time any node may read which value currently stands. Each node keeps its own copy of the value. A write is complete once the client who made it is told that it took effect; a read is complete once the client who asked is given an answer of 1 or 0.
What makes tonight different from the other stories at the foot of the hill is that ravens can be lost. Hunting hawks circle the folds of the mountain and can snatch a raven out of the air so that it never arrives. Because nobody can see into the ravines, a mercenary waiting for a raven only learns it was taken when the maximum flight time has elapsed and their perch is still empty, and even then, they have no idea what strip the lost bird was carrying. Worse still, when hawks settle in the ravine around one tent, every bird flying to or from that tent is taken for as long as the hawks stay there. That tent is cut off (partitioned) from the rest of the camp.What makes this setting different from the others in the series is that messages can be lost. The network can drop a message so that it never arrives. Because nobody can see inside the network, a node waiting for a message only learns it was lost when the maximum delivery time has elapsed and nothing has arrived, and even then, it has no idea what the lost message was carrying. Worse still, when a failure isolates one node, every message to or from that node is dropped for as long as the failure lasts. That node is cut off (partitioned) from the rest of the system.
Try sending ravens across the hill below. With no hawks in the sky, every bird lands within a single flight. Then bring the hawks to Tent 4's ravine, send a bird between Tent 2 and Tent 4, and let a flight pass.Try sending messages between the nodes below. With no failure, every message arrives within one delivery time. Then cut P4 off, send a message between P2 and P4, and let a delivery time pass.
The hill from above. A raven is a dot flying between two tents. While hawks circle the ravine by Tent 4, every bird flying to or from Tent 4 is lost.Each lane is one node, with real time running left to right. A message is an arrow; a lost one ends in a cross. While P4 is cut off, its lane is hatched, and every message to or from P4 is lost.
Send a bird, and see whether it comes.Send a message, and see whether it arrives.
Now imagine that Tent 4 is cut off by hawks. Number 4 is alive and alert inside their tent, and they ask which plan currently stands. The question is what Tent 4 should answer, and whether any arrangement can satisfy everything the four mercenaries want at once.Now imagine that P4 is cut off. A client of P4 is waiting, and asks which value currently stands. The question is what P4 should answer, and whether any protocol can satisfy everything the four nodes want at once.
The mercenaries want their arrangement for keeping the standing plan to pay two debts at the same time, even on nights when hawks are taking birds.The nodes want their protocol for keeping the shared value to provide two guarantees at the same time, even when the network is losing messages.
The first debt governs what an answer must say; the second governs whether an answer is always given; and the condition is that ravens may be lost.The first guarantee governs what an answer must say; the second governs whether an answer is always given; and the condition is that messages may be lost.
Although each tent keeps its own note, the camp as a whole must behave as if all four mercenaries were reading and updating a single shared record (atomic consistency, or linearizability).* In particular, once Number 2 has moved the plan to attack and been told that their move stands, anyone who asks afterward at any tent must hear attack (unless an even later move has changed it again).Although each node keeps its own copy, the service as a whole must behave as if all clients were reading and updating a single shared object (atomic consistency, or linearizability).* In particular, once a client has written 1 and been told the write took effect, anyone who reads afterward at any node must see 1 (unless an even later write has changed it again).
Whenever a mercenary moves the plan or asks which plan stands, they must eventually receive an answer (availability). There is no fixed deadline for how quickly the answer must come, only that they cannot be left waiting forever.Whenever a client writes or reads at a node that is up, it must eventually receive an answer (availability). There is no fixed deadline for how quickly the answer must come, only that the client cannot be left waiting forever.
Hawks may snatch any raven, including every raven between one tent and the rest of the camp, and the two debts above must still be honored (partition tolerance).The network may drop any message, including every message between one node and the rest of the system, and the two guarantees above must still be honored (partition tolerance).
Look at two naive ways a tent might try to behave when Number 2 has already moved the plan to attack, hawks are circling, and Number 3 asks which plan stands. If Tent 3 simply answers from its local note of hold right away, it pays the second debt (Number 3 gets an answer) but breaks the first (the answer is stale). If Tent 3 waits for news from the others until the hawks leave, it never gives a stale answer, but if the hawks stay all night, Number 3 waits forever, breaking the second debt. Try both below.Look at two naive ways a node might behave when a client has written 1 at P2, the network is dropping messages, and a client at P3 reads. If P3 simply answers from its local copy of 0 right away, it keeps the second guarantee (the client gets an answer) but breaks the first (the answer is stale). If P3 waits for updates from the others until the network recovers, it never gives a stale answer, but if the failure lasts forever the client waits forever, breaking the second guarantee. Try both below.
Number 2 has moved the plan to attack and been told it stands. Later Number 3 asks which plan stands.A client has written 1 at P2 and been told it took effect. Later a client reads at P3.
A cleverer arrangement might do better by using timing, since the mercenaries have two strong timing advantages tonight. First, each tent has a sandglass that runs at the same rate as the others, so every mercenary can measure exactly how long they have been waiting (even if the four glasses were not started at the same moment). Second, there is no wind tonight: any raven that is not taken by a hawk is guaranteed to arrive within a known flight time.*A cleverer protocol might do better by using timing, since the nodes have two strong timing advantages here. First, each node has a timer that runs at the same rate as the others, so every node can measure exactly how long it has been waiting (even if the timers were not started at the same moment). Second, the network is well behaved: any message that is not lost is guaranteed to arrive within a known delivery time.*
The question is whether, with known flight times and reliable sandglasses in every tent, the four mercenaries can design an arrangement that answers as one, answers every mercenary, and tolerates lost birds all at once.The question is whether, with known delivery times and reliable timers at every node, the four can design a protocol that acts as one copy, answers every request, and tolerates lost messages all at once.

Gilbert & Lynch's partially synchronous model with arbitrary message loss, §4.1: a known bound tmsg on delivery of messages that are not lost, and local timers running at the same rate.
No arrangement can have all three. Out of the three desires, answering as one, answering every mercenary, and carrying on while birds can be lost, no arrangement can ever guarantee more than two. Eric Brewer first stated this trade-off as a conjecture in 2000, and Seth Gilbert and Nancy Lynch proved it in 2002.They cannot. Out of the three desires, acting as one copy, answering every request, and carrying on while messages can be lost, no protocol can ever guarantee more than two. Eric Brewer first stated this trade-off as a conjecture in 2000, and Seth Gilbert and Nancy Lynch proved it in 2002.
The Cut-Off Tent (The CAP Theorem). When ravens can be lost, no arrangement of the four tents can both answer every mercenary and answer as one, even when flights have a known time bound and every tent has an accurate sandglass.The CAP Theorem. When messages can be lost, no protocol can both answer every request and act as one copy, even when delivery times have a known bound and every node has an accurate timer.
The proof is simple and inescapable. Imagine two possible nights that both begin with the standing plan at hold and Tent 4 completely cut off by hawks. On the first night, Number 2 moves the plan to attack; on the second night, nobody moves the plan at all. Scroll through the two nights below and watch what Number 4 can observe inside Tent 4.The proof is simple and inescapable. Imagine two possible executions that both begin with the shared value at 0 and P4 completely cut off. In the first, a client writes 1 at P2; in the second, nobody writes at all. Scroll through the two executions below and watch what P4 can observe.
At dusk the standing plan is hold. Hawks settle in Tent 4's ravine, snatching every raven that flies between Tent 4 and the other three tents.At the start the shared value is 0. The network drops every message between P4 and the other three nodes.
On the first night, Number 2 moves the plan to attack. Because every mercenary must be answered, Number 2 eventually receives confirmation that their move stands (say after some time). Any ravens sent toward Tent 4 are taken by the hawks.In the first execution, a client writes 1 at P2. Because every request must be answered, it eventually receives confirmation that the write took effect (say after some time T). Any messages sent toward P4 are lost.
On the second night, nobody moves the plan. After more than that time has passed in silence, Number 4 asks which plan stands. Because every mercenary must be answered, and nobody has moved the plan from hold, Tent 4 must eventually answer hold.In the second execution, nobody writes. After more than time T has passed with no message arriving, a client reads at P4. Because every request must be answered, and nobody has changed the value from 0, P4 must eventually answer 0.
Now combine the two nights: let Tents 1, 2, and 3 experience the first night (Number 2 moves the plan to attack, completing by that time), and then after that time let Number 4 ask which plan stands, just as on the second night.Now combine the two executions: let P1, P2 and P3 experience the first (a client writes 1 at P2, completing by time T), and then after time T let a client read at P4, just as in the second.
Because the hawks intercept every raven between Tent 4 and the others, everything Number 4 sees, their note, their sandglass, and their empty perch, is 100% identical to the second night. So Tent 4 must give the exact same answer: hold. Yet Number 2's move to attack finished before Number 4 even asked! Answering as one is broken.Because the network drops every message between P4 and the others, everything P4 sees, its copy, its timer, and its empty inbox, is 100% identical to the second execution. So P4 must give the exact same answer: 0. Yet the write of 1 finished before the read even began! Consistency is broken.
Notice that Number 4 did nothing foolish. From inside Tent 4, the combined night is completely indistinguishable from the quiet second night where nobody ever moved the plan, and on that quiet night, hold is the only valid answer! Because Tent 4 must eventually give some answer on both nights without receiving a single raven from outside, whatever answer is right on one night is guaranteed to be wrong on the other.Notice that P4 followed the protocol correctly. From inside P4, the combined execution is completely indistinguishable from the second execution, where nobody ever wrote, and in that execution, 0 is the only valid answer! Because P4 must eventually give some answer in both executions without receiving a single message from outside, whatever answer is right in one is guaranteed to be wrong in the other.
Notice too why known flight times and sandglasses could not save Number 4. Waiting a glass tells Number 4 that a bird may have been lost, or that no bird was sent, but no amount of watching sand fall can tell them whether Number 2 moved the plan on the other side of the hill. Nor is there anything special about slicing off one tent against three: if the hawks divide the camp into any two isolated groups, a move in one group followed by a question in the other triggers the exact same contradiction.Notice too why known delivery times and timers could not save P4. Waiting out a timeout tells P4 that a message may have been lost, or that none was sent, but no amount of waiting can tell it whether a write happened on the other side of the partition. Nor is there anything special about slicing off one node against three: if the network splits the nodes into any two isolated groups, a write in one group followed by a read in the other triggers the exact same contradiction.
Since the four mercenaries cannot have all three guarantees at once, what remains is to achieve any two of them and to come as close as possible to all three.Since the four nodes cannot have all three guarantees at once, what remains is to achieve any two of them and to come as close as possible to all three.
In the paper's terms the tents are nodes, a lost bird is a lost message, a cut-off tent is a partition, answering every mercenary is availability, and answering as one is atomic consistency. Theorem 2. In the partially synchronous model, with a known bound on delivery of messages that are not lost and local timers at the same rate, no algorithm guarantees both availability and atomic consistency in all executions, including those in which messages are lost. The two nights are the paper's executions α₁ and α′₂, put together they are its α, and T below is a time measured by the glass.Theorem 2. In the partially synchronous model, with a known bound on delivery of messages that are not lost and local timers at the same rate, no algorithm guarantees both availability and atomic consistency in all executions, including those in which messages are lost. The two executions are the paper’s α₁ and α′₂, put together they are its α, and T below is a time measured by the timer.
Although the four cannot have all three properties at once, they can easily have any two of the three. In fact, one simple arrangement, appointing one tent as the muster-master (a centralized primary), already delivers two of the three pairings.Although the four cannot have all three properties at once, they can easily have any two of the three. In fact, one simple protocol, appointing one node as the primary (a centralized primary node), already delivers two of the three pairings.
The reason to appoint a muster-master is that whenever four tents each maintain an independent note of the plan, their notes can drift out of sync. If Number 2 changes their note to attack while Tent 3's note still says hold, the camp has two conflicting records. Since "answering as one" requires the camp to behave as if there were a single record, the simplest way to guarantee it is to actually keep a single master record at one tent, say Tent 1.The reason to appoint a primary is that whenever four nodes each maintain an independent copy of the value, their copies can drift out of sync. If a client writes 1 at P2 while P3’s copy still says 0, the system has two conflicting records. Since consistency requires the system to behave as if there were a single record, the simplest way to guarantee it is to actually keep a single master record at one node, say P1.
What the muster-master does. Being the muster-master gives Number 1 no special authority over strategy; their job is purely clerical. Tent 1 holds the only official note of the standing plan. Whenever a mercenary at Tent 2, 3, or 4 wants to move the plan, they send a raven to Tent 1 and waits; Number 1 updates the master note and sends a confirmation raven back, and only when that raven lands is the move complete. Whenever a mercenary wants to ask which plan stands, they likewise sends a raven to Tent 1 and waits for Number 1 to read the master note and send back the answer. (Number 1 themselves, already sitting in Tent 1, can update or read the note on the spot.)What the primary does. P1 holds the only official copy of the value. Whenever a client at P2, P3 or P4 wants to write, the node sends a request message to P1 and waits; P1 updates the master copy and sends a confirmation back, and only when that message arrives is the write complete. Whenever a client wants to read, the node likewise sends a request to P1 and waits for P1 to read the master copy and send back the answer. (A client at P1 itself can write or read the copy on the spot.)
Why this always answers as one. Because Number 1 handles incoming ravens one at a time in the order they arrive at Tent 1, every move and every question across the entire camp falls into a single, unambiguous sequence. Any move that finishes before a question begins must have been updated on Tent 1's note before the question's raven was answered. Thus every answer ever given in the camp is guaranteed to be consistent, whether hawks are out or not.Why this is always consistent. Because P1 handles incoming requests one at a time in the order they arrive, every write and every read across the entire system falls into a single, unambiguous sequence. Any write that finishes before a read begins must have updated P1’s copy before the read’s request was answered. Thus every answer ever given is guaranteed to be consistent, whether messages are lost or not.
What it costs when hawks appear. Because Tents 2, 3, and 4 never answer a move or a question until a raven has flown to Tent 1 and returned, any tent cut off from Tent 1 by hawks waits forever for a reply. The muster-master's arrangement keeps the first debt (answering as one) on every night, and pays the second debt (answering every mercenary) only when no birds are lost. Together with the opposite choice, letting each tent answer immediately from its own local note, this gives all three two-out-of-three pairings:What it costs when messages are lost. Because P2, P3 and P4 never answer a request until a message has travelled to P1 and back, any node cut off from P1 waits forever for a reply. The primary-copy protocol keeps the first guarantee (consistency) in every execution, and provides the second (availability) only when no messages are lost. Together with the opposite choice, letting each node answer immediately from its own local copy, this gives all three two-out-of-three pairings:
Every move and question goes through Tent 1. When Tent 4 is cut off by hawks, Number 4 gets no reply and waits silently, so no stale answer is ever given.Every write and read goes through P1. When P4 is cut off, its client gets no reply and waits, so no stale answer is ever given.
On a night when no ravens are lost, every bird to and from Tent 1 arrives promptly, so the muster-master's arrangement both answers as one and answers every mercenary.When no messages are lost, every message to and from P1 arrives promptly, so the primary-copy protocol is both consistent and available.
Every mercenary answers immediately from whatever note sits in their own tent. Every question gets an instant reply even under the hawks, at the cost of returning stale answers.Every node answers immediately from whatever copy it holds. Every request gets an instant reply even during a partition, at the cost of returning stale answers.
Compare the three scenarios below when Number 2 moves the plan to attack and Number 4 asks afterward.Compare the three scenarios below when a client writes 1 at P2 and a client reads at P4 afterward.
Choose a night.Choose an execution.
Look closely at the third option: if each tent always answers immediately from its own local note, it can give a stale answer even on a calm night with no hawks at all (while a bird is still in flight). Yet on most nights, there are no hawks in the ravines! Surely the mercenaries should not have to give up consistency on hawk-free nights just to make sure nobody waits forever when hawks do show up.Look closely at the third option: if each node always answers immediately from its own local copy, it can give a stale answer even in an execution with no failure at all (while a message is still in transit). Yet most of the time, the network is working! Surely the nodes should not have to give up consistency in good times just to make sure nobody waits forever when a failure does show up.
The centralized algorithm, §3.2.1–3.2.2.
In the paper's terms the muster-master is the designated node of the centralized algorithm, and answering as one is atomic consistency. Claim. Ordering all moves and questions by the moment the muster-master dealt with them, every answer is what a single record would say, each takes effect between its start and its answer, and anything finished before another began comes first.Claim. Ordering all writes and reads by the moment the primary dealt with them, every answer is what a single object would return, each takes effect between its start and its answer, and anything finished before another began comes first.
With their sandglasses and a known flight time, the mercenaries can get the best of both worlds on calm nights: they can answer every mercenary on every night, and still answer as one on every night when no bird is lost.With their timers and a known delivery time, the nodes can get the best of both worlds when the network is working: they can answer every request in every execution, and still act as one copy in every execution where no message is lost.
They combine the muster-master's arrangement with a wait measured by the sandglass. Because any raven that is not taken by a hawk lands within one flight time, a round trip to Tent 1 and back (plus Number 1's brief moment to write a reply) never takes longer than one sandglass. If a mercenary waits a full glass and still has no reply from Tent 1, they know for certain that a hawk took either their raven or Tent 1's reply, and only then does they fall back to their own local note:They combine the primary-copy protocol with a timeout. Because any message that is not lost arrives within one delivery time, a round trip to P1 and back (plus P1’s brief moment to write a reply) never takes longer than one timeout. If a node waits a full timeout and still has no reply from P1, it knows for certain that the network lost either its request or P1’s reply, and only then does it fall back to its own local copy:
Whenever a mercenary moves the plan or asks which plan stands, they send a raven to the muster-master at Tent 1 and flips their sandglass (sized for two flights plus Tent 1's reply time).Whenever a client writes or reads, the node sends a request to the primary at P1 and starts a timer (sized for two delivery times plus P1’s reply time).
If the muster-master's reply arrives before the sand runs out, they use the muster-master's answer.If the primary’s reply arrives before the timer runs out, the node uses the primary’s answer.
If the sandglass runs empty first, a hawk took the bird. The mercenary stops waiting and answers from their own tent's note: a move is declared to stand locally, and a question returns the latest plan Tent 1 has sent them (or their own local move, if they made one since).If the timer runs out first, the network lost a message. The node stops waiting and answers from its own copy: a write is declared to have taken effect locally, and a read returns the latest value P1 has sent it (or its own local write, if it made one since).
Try this below. Earlier tonight, Number 2 moved the plan to attack at Tent 1, while Tent 4's local note still says hold. First let Number 4 ask with no hawks about, then bring the hawks to Tent 4's ravine and watch the glass run out.Try this below. Earlier, a client wrote 1 at P1, while P4’s local copy still says 0. First let a client read at P4 with the network working, then cut P4 off and watch the timer run out.
Waiting a glass works well for two reasons. On any night when no bird is lost, no sandglass ever runs out, so every move and question is handled by Tent 1 in a single consistent order. And on nights when hawks do snatch a bird, the sandglass runs out and the waiting mercenary answers from their own note, so nobody ever waits forever. Consistent answers are sacrificed only when ravens are actually lost.Waiting out a timeout works well for two reasons. In any execution where no message is lost, no timer ever runs out, so every write and read is handled by P1 in a single consistent order. And when the network does lose a message, the timer runs out and the waiting node answers from its own copy, so nobody ever waits forever. Consistent answers are sacrificed only when messages are actually lost.
Look closely, however, at what happens after the hawks leave. Suppose that while Tent 4 was cut off by hawks, Number 4 moved the plan to hold, their raven was taken, and after one glass their move stood locally at Tent 4. Then the hawks fly away. Because that single raven was lost and nothing tells Tent 4 to resend it, Tent 1 never learns of Number 4's move! Hours after the sky is completely clear of hawks, Tents 1, 2, and 3 are still operating under a different plan from Tent 4. You can see this in the interactive above: bring the hawks to Tent 4, have Number 4 move the plan to hold, send the hawks away, and then let Number 2 ask.Look closely, however, at what happens after the failure ends. Suppose that while P4 was cut off, a client wrote 0 at P4, the request was lost, and after one timeout the write took effect locally at P4. Then the network recovers. Because that single message was lost and nothing tells P4 to resend it, P1 never learns of the write! Long after the network is completely healthy, P1, P2 and P3 are still operating on a different value from P4. You can see this in the interactive above: cut P4 off, write 0 at P4, restore the network, and then read at P2.
A single lost bird during a brief visit by the hawks has left the camp permanently out of sync. To make sure the damage from a partition is only temporary, the mercenaries need a way to catch up once the hawks leave.A single lost message during a brief failure has left the system permanently out of sync. To make sure the damage from a partition is only temporary, the nodes need a way to catch up once the network recovers.
A timeout of 2tmsg + tlocal, §4.3.
With one more refinement, the four mercenaries can guarantee that the damage from lost birds ends within a fixed span of time after the hawks leave (consistency after a calm span). Nobody can control how long the hawks stay, of course, but the four can strictly bound how long it takes the camp to heal once the hawks are gone.With one more refinement, the four nodes can guarantee that the damage from lost messages ends within a fixed span of time after the network recovers (Delayed-t consistency). Nobody can control how long a failure lasts, of course, but the four can strictly bound how long it takes the system to heal once it is over.
Healing requires two things: any move made at a cut-off tent must eventually reach the muster-master at Tent 1, and the muster-master's updated plan must then reach every tent. Because ravens can arrive out of order, every bird a mercenary sends to Tent 1 carries, in order, all of their moves that Tent 1 has not yet acknowledged, and they keep resending them periodically until Tent 1 acknowledges them. As each move reaches Tent 1, the muster-master assigns it the next sequential stamp (1, 2, 3, …) and broadcasts the current plan along with its stamp to every tent, resending until acknowledged. Each tent always keeps whichever plan has the highest stamp it has seen. Scroll through the steps below to watch how a move made while Tent 4 is cut off propagates through the camp once the hawks leave.Healing requires two things: any write made at a cut-off node must eventually reach the primary at P1, and the primary’s updated value must then reach every node. Because messages can arrive out of order, every message a node sends to P1 carries, in order, all of its writes that P1 has not yet acknowledged, and it keeps resending them periodically until P1 acknowledges them. As each write reaches P1, the primary assigns it the next sequence number (1, 2, 3, …) and broadcasts the current value along with its sequence number to every node, resending until acknowledged. Each node always keeps whichever value has the highest sequence number it has seen. Scroll through the steps below to watch how a write made while P4 is cut off propagates through the system once the network recovers.
Hawks circle Tent 4's ravine. Number 4 moves the plan to attack and sends a raven to Tent 1. The hawk takes the bird, and after one glass Number 4's move stands locally at Tent 4.P4 is cut off. A client writes 1 at P4 and the node sends a request to P1. The network drops it, and after one timeout the write takes effect locally at P4.
Number 4 keeps resending their unacknowledged move at regular intervals (frequently enough that once the sky clears, a bird is guaranteed to reach Tent 1 within half the recovery span). While the hawks remain, each bird is taken.P4 keeps resending its unacknowledged write at regular intervals (frequently enough that once the network recovers, a message is guaranteed to reach P1 within half the recovery span). While the failure lasts, each message is lost.
As soon as the hawks leave, Number 4's next raven reaches Tent 1. The muster-master updates the master note to attack and gives the move the next stamp.As soon as the network recovers, P4’s next message reaches P1. The primary updates the master copy to 1 and gives the write the next sequence number.
The muster-master broadcasts the updated plan and its new stamp to every tent, resending to any tent that has not yet acknowledged it (frequently enough to arrive within the second half of the recovery span).The primary broadcasts the updated value and its new sequence number to every node, resending to any node that has not yet acknowledged it (frequently enough to arrive within the second half of the recovery span).
Once a single full span has elapsed without any lost birds, every move finished before that span has been stamped at Tent 1 and delivered to all four tents.Once a single full span has elapsed without any lost messages, every write finished before that span has been sequenced at P1 and delivered to all four nodes.
Any question asked at any tent after that calm span is guaranteed to see Number 4's move (or an even later move). When Number 3 asks now, they hear attack.Any read at any node after that calm span is guaranteed to see the write at P4 (or an even later write). When a client reads at P3 now, it sees 1.
The Span (consistency after a calm span). The muster-master's arrangement with resending and stamps answers every mercenary on every night, answers as one on any hawk-free night, and guarantees that once no birds are lost for a span of a fixed length, any operation completed before that span is visible to any operation that starts after it.The Span (Delayed-t Consistency). The primary-copy protocol with resending and sequence numbers answers every request in every execution, acts as one copy in any execution where no message is lost, and guarantees that once no messages are lost for a span of length t, any operation completed before that span is visible to any operation that starts after it.
Two mercenaries may move the plan in opposite ways while one of them is cut off. Suppose the plan starts at attack (stamp 1), and while Tent 4 is cut off, Number 2 moves the plan to hold (which reaches Tent 1 right away and gets stamp 2) while Number 4 moves the plan to attack (which times out locally at Tent 4). When the hawks leave and Number 4's resend finally reaches Tent 1, the muster-master stamps Number 4's move with stamp 3 and broadcasts it to everyone. Both moves are ordered cleanly by their stamps (stamp 2, then stamp 3), and after one calm span all four tents agree on stamp 3! During the partition itself, of course, the two sides saw different plans, which the Cut-Off Tent proved no available arrangement can avoid. Step through this two-writer scenario below.Two clients may write conflicting values while one of them is cut off. Suppose the value starts at 1 (sequence number 1), and while P4 is cut off, a client writes 0 at P2 (which reaches P1 right away and gets sequence number 2) while a client writes 1 at P4 (which times out locally at P4). When the network recovers and P4’s resend finally reaches P1, the primary gives that write sequence number 3 and broadcasts it to everyone. Both writes are ordered cleanly by their sequence numbers (2, then 3), and after one calm span all four nodes agree on sequence number 3! During the partition itself, of course, the two sides saw different values, which the CAP theorem proved no available protocol can avoid. Step through this two-writer scenario below.
Notice that every part of this recovery scheme relied on a known maximum flight time: waiting a single glass to detect a lost bird, spacing the resends, and measuring the recovery span itself. Suppose the mountain wind rises again, so that a raven can sit in the pines for an arbitrary amount of time.Notice that every part of this recovery scheme relied on a known maximum delivery time: waiting a single timeout to detect a lost message, spacing the resends, and measuring the recovery span itself. Suppose delays have no bound, so that a message can sit in the network for an arbitrary amount of time.
All the moves and questions can be set in one order P, with t the span, fixed in advance and measured by the glass, in which:All the writes and reads can be set in one order P, with t the span, fixed in advance and measured by the timer, in which:
Delayed-t consistency, Definition 3.
At every tent, always: every bird from the muster-master carries the plan and its stamp, and a mercenary goes by the one with the highest stamp to have come. Every bird a mercenary sends the muster-master carries all that mercenary's unacknowledged moves, in order.At every node, always: every message from the primary carries the value and its sequence number, and a node goes by the one with the highest sequence number to have arrived. Every message a node sends the primary carries all that node’s unacknowledged writes, in order.
A question: send to the muster-master and wait a glass. If the muster-master answers in time, give that answer. If not, give the latest of the asker's own unacknowledged moves, or if there is none, the plan with the highest stamp the asker holds.A read: send to the primary and start a timer. If the primary answers in time, return that answer. If not, return the latest of the node’s own unacknowledged writes, or if there is none, the value with the highest sequence number the node holds.
A move: send to the muster-master and wait a glass. It stands when the muster-master acknowledges it or the glass runs out, whichever is first. Until acknowledged, send it again, often enough that with no bird lost it reaches the muster-master within half of t.A write: send to the primary and start a timer. It takes effect when the primary acknowledges it or the timer runs out, whichever is first. Until acknowledged, send it again, often enough that with no message lost it reaches the primary within half of t.
At the muster-master: each move that reaches the muster-master, taken in its sender's order, changes the muster-master's note and takes the next stamp. The muster-master sends the plan and stamp to every tent, again and again to any that has not acknowledged it, often enough that with no bird lost they arrive within half of t.At the primary: each write that reaches the primary, taken in its sender’s order, changes the primary’s copy and takes the next sequence number. The primary sends the value and sequence number to every node, again and again to any that has not acknowledged it, often enough that with no message lost they arrive within half of t.
The modified centralized algorithm, Theorem 4.
In the paper's terms (Definition 3 and Theorem 4), t is the span, fixed in advance and measured by the local timers, and P is an order on all the moves and questions of a night. Claim. On every night the muster-master's arrangement with a span answers every mercenary, and admits an order P satisfying clauses (1) to (5) of the promise of the span, stated above.Here (Definition 3 and Theorem 4) t is the span, fixed in advance and measured by the local timers, and P is an order on all the writes and reads of an execution. Claim. In every execution the primary-copy protocol with a span answers every request, and admits an order P satisfying clauses (1) to (5) of the promise of the span, stated above.
The paper's own proof of this is a few lines long, and says nothing about how a mercenary should treat moves of that mercenary's own that the muster-master has not yet acknowledged; the second step supplies it.The paper’s own proof of this is a few lines long, and says nothing about how a node should treat its own writes that the primary has not yet acknowledged; the second step supplies it.
When the wind blows and flights have no time bound, waiting a glass no longer tells a mercenary whether their raven was taken by a hawk or is merely sitting in the pines.When delivery times have no bound (an asynchronous network), waiting out a timeout no longer tells a node whether its message was lost or is merely delayed.
On a windy night, a raven can be delayed for any length of time.* Because a waiting mercenary cannot distinguish a lost bird from a slow one, an even harsher impossibility takes hold:In an asynchronous network, a message can be delayed for any length of time.* Because a waiting node cannot distinguish a lost message from a slow one, an even harsher impossibility takes hold:
The Wind (the corollary for unbounded flights). When flight times have no bound, no arrangement that guarantees an answer to every mercenary on every night can guarantee answering as one, even on nights when not a single bird is lost!The Asynchronous CAP Corollary. When delivery times have no bound, no protocol that guarantees an answer to every request in every execution can guarantee consistency, even in executions where not a single message is lost!

Compare the two windy nights below from Tent 4's point of view. On the left night, a hawk takes Number 4's bird; on the right night, there are no hawks at all, and the bird simply waits out a gust in a pine tree. Step through to see what happens.Compare the two executions below from P4’s point of view. On the left, the network drops P4’s message; on the right, nothing is dropped, and the message is simply delayed. Step through to see what happens.
Suppose a hawk takes the bird.Suppose the network drops the message.
Suppose the bird sits out the wind in a pine.Suppose the message is only delayed.
Number 2 has moved the plan to attack and been told it stands. Number 4 now asks which plan stands.A client has written 1 at P2 and been told it took effect. A client now reads at P4.
Look at the second night: not a single bird was taken by a hawk, and every raven eventually arrived! Yet because the arrangement had to guarantee an answer even if hawks had taken the bird, Number 4 was forced to give up waiting and answer hold while their bird was still sitting in the pine. Without a known bound on flight time, a slow bird looks identical to a lost bird, so any arrangement that stays available during partitions will also return stale answers whenever strips run late.Look at the second execution: not a single message was lost, and every message eventually arrived! Yet because the protocol had to guarantee an answer even if the network had dropped the message, P4 was forced to give up waiting and answer 0 while its message was still in transit. Without a known bound on delivery time, a slow message looks identical to a lost message, so any protocol that stays available during partitions will also return stale answers whenever messages run late.
In the paper's terms a night is an execution, and in the asynchronous model there is no bound on message delay. Corollary 1.1. No algorithm that guarantees availability in every execution guarantees atomic consistency in every execution in which no message is lost.Corollary 1.1. In the asynchronous model there is no bound on message delay, and no algorithm that guarantees availability in every execution guarantees atomic consistency in every execution in which no message is lost.
Because the CAP theorem is so famous, it is often overstated. Four questions clarify its exact boundaries.
No, the impossibility proven across the water in the Chamber of Paxos is a cousin, not the same theorem.* Both pit a safety property against a liveness property, but under different assumptions: in FLP, no messengers are ever lost, delays have no time bound, and one legislator may depart; in CAP, no mercenary dies, flights have a known time bound, and ravens can be lost.No, the FLP impossibility result is a cousin, not the same theorem.* Both pit a safety property against a liveness property, but under different assumptions: in FLP, no messages are ever lost, delays have no bound, and one node may crash; in CAP, no node crashes, delays have a known bound, and messages can be lost.
No. A dead mercenary asks no questions and is owed no answers. The Cut-Off Tent is about a living, working mercenary (Number 4) who is cut off from their comrades by lost strips and still demands a reply.No. A crashed node serves no requests and owes no answers. CAP is about a working node (P4) that is cut off from the others by lost messages and still has a client demanding a reply.
No, it applies only to state that can change and must stay coordinated across tents. Facts that never change (like which tent number each mercenary occupies) or monotonic facts that require no coordination can be answered locally at any time without ever being wrong.*No, it applies only to state that can change and must stay coordinated across nodes. Facts that never change (like which number each node has) or monotonic facts that require no coordination can be answered locally at any time without ever being wrong.*
No. A real system does not have to make a single blanket choice for everything it does. It can insist on the muster-master's strict consistency for critical updates while allowing local notes to answer routine queries, or bound staleness using a recovery span. CAP simply warns us where the trade-off must be paid whenever a partition strikes.No. A real system does not have to make a single blanket choice for everything it does. It can insist on the primary’s strict consistency for critical updates while allowing local copies to answer routine reads, or bound staleness using a recovery span. CAP simply warns us where the trade-off must be paid whenever a partition strikes.
A distributed service cannot be simultaneously consistent, available, and partition-tolerant.
Because network partitions are unavoidable in the real world, the true choice arrives when a link fails: either wait and refuse some requests to keep every answer consistent, or answer every request locally and allow copies to diverge until the partition heals.
This is one instance of a wider truth: safety ("never return a wrong answer") and liveness ("always return an answer") often cannot both be guaranteed in an unreliable network, so practical systems tailor the trade-off by data type and by operation.
Setting Four Mercenaries Who Must Agree
Eric A. Brewer, Towards Robust Distributed Systems. Invited talk, 19th ACM Symposium on Principles of Distributed Computing (PODC), Portland, Oregon, July 2000. — Formulates the CAP conjecture: among Consistency, Availability, and Partition tolerance, a distributed shared-data system can achieve at most two.
Seth Gilbert and Nancy Lynch, Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services. ACM SIGACT News 33, 2 (June 2002), 51–59. — Formalizes Brewer's conjecture using atomic consistency (linearizability), proves the impossibility in both asynchronous and partially synchronous models (Theorems 1 and 2, Corollary 1.1), and presents the centralized algorithm and Delayed-t consistency (Theorem 4).
Seth Gilbert and Nancy Lynch, Perspectives on the CAP Theorem. IEEE Computer 45, 2 (February 2012), 30–36. — Explains CAP as a trade-off between safety and liveness, compares it with the FLP impossibility result, and discusses how practical systems partition the trade-off.
The ideas, plainly. In 2000, Eric Brewer observed from practical experience building large-scale web services that a distributed shared-data system can simultaneously provide at most two of three desirable properties: Consistency, Availability, and Partition tolerance. Two years later, Seth Gilbert and Nancy Lynch gave the conjecture a precise mathematical footing and proved it. They defined Consistency as linearizability (atomic read/write registers, where every read reflects the latest completed write), Availability as the guarantee that every request received by a non-failing node eventually returns a response, and Partition tolerance as the requirement that the system satisfy its guarantees even when the network drops arbitrary messages between isolated subsets of nodes.
The proof is a direct indistinguishability argument. Partition the nodes into two isolated groups, G1 and G2, dropping all messages between them. Suppose a client writes a new value in G1 and waits until the write completes, and afterwards another client reads in G2. Because no messages have crossed the partition, the nodes in G2 cannot distinguish this execution from one in which no write ever occurred in G1. If G2 must be available, it must eventually return a value—and that value must be the initial value, violating linearizability. Local clocks and known message delivery bounds do not prevent this contradiction, because a timeout only reveals that messages were lost, not what value was written on the other side.
When networks are partially synchronous (messages that are not dropped arrive within a known bound tmsg and nodes have synchronized timer rates), a system can achieve consistency and availability in all executions where no messages are lost, while falling back to local responses when a timeout detects message loss. By piggybacking unacknowledged writes and version stamps, the system can also guarantee Delayed-t consistency: once the network heals and delivers messages reliably for a span of length t, consistency is fully restored. In a purely asynchronous network (where message delays are unbounded), even that fallback fails: any always-available protocol can return stale answers even when no messages are ever lost.