← The Books

Answering While Cut Off

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

At the mouth of his tent at night, a mercenary stands alone with a tiny message just taken from a raven's leg, looking out into the dark; a raven on the basket beside him, cypresses and scrub behind under the full moon
Where this book sits
Draws on
This book retells
Leads to

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

Looking out from the mouth of a tent at night: the tent poles framing the basket, the chest and the leaning shield, the bare clearing and dark scrub beyond
The foot of Mount PhyleThe model

Four tents, out of sight of one anotherFour nodes, one unreliable network

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.

A known flightUntil the final section of this book, the air is calm: any raven that is not intercepted reaches its destination within a known flight time.Known delayUntil the final section of this book, the network is well behaved: any message that is not lost reaches its destination within a known delivery time.
A hawk may take any birdHunting hawks prowl the ravines. A hawk may snatch any raven in mid-flight; nobody sees the bird taken, and it never arrives.Messages may be lostThe network may drop any message in transit; nobody sees it dropped, and it never arrives.
Nobody stops, nobody commitsOn these nights no mercenary is killed, no one lies, and nobody steps out to commit. Instead, the four maintain a shared standing plan that any of them can update or query during the night.No crashes, no decisionsIn these executions no node crashes, nobody lies, and nobody decides anything once and for all. Instead, the four maintain a shared value that any of them can update or query at any time.
A plan to followA value to keep

The standing planThe shared value

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.

Ravens and hawks send a bird and see what comesMessages and loss send a message and see what comes

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.

Two debts, and a conditionTwo guarantees, and a condition

What the four owe each otherWhat the service owes its clients

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.

First debtFirst guarantee

Answering as oneActing as one copy

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).

Second debtSecond guarantee

Every mercenary is answeredEvery request is answered

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.

The condition

Birds may be lostMessages may be lost

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.

Two ways to answer badly Number 3 asksTwo ways to answer badly a client reads at P3

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.

Close up of a sandglass on the lid of an iron-bound chest by moonlight, the round shield leaning beside it and a guy rope of the tent across the corner
The camps of this book, stated formallyThe model of this book, stated formally
  1. On these nights there is no wind: any raven that is not taken by a hawk arrives within a known maximum flight time, and any mercenary processes an incoming raven within a known local time bound.There are no unbounded delays: any message that is not lost arrives within a known maximum delivery time, and any node processes an incoming message within a known local time bound.
  2. Any raven may be lost, and between a cut-off tent and the rest of the camp every raven is lost for as long as the hawks remain in that ravine.Any message may be lost, and between a cut-off node and the rest of the system every message is lost for as long as the failure lasts.
  3. Each tent has a sandglass running at the same rate, allowing each mercenary to measure the duration of any wait, though the four glasses need not show the same time.Each node has a timer running at the same rate, allowing each node to measure the duration of any wait, though the four timers need not show the same time.

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.

The first result

The cut-off tentThe cut-off node

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.

1 · Dusk1 · The start

Tent 4 is cut offP4 is cut off

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.

2 · The first night2 · The first execution

Number 2 moves the planA client writes at P2

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.

3 · The second night3 · The second execution

Nobody moves the planNobody writes

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.

4 · Put together

Both nights at onceBoth executions at once

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.

5 · So

Number 4 says holdP4 answers 0

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.

Proof · that no arrangement both answers every mercenary and answers as oneProof · that no protocol both answers every request and acts as one copy

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.

  1. Suppose some arrangement did both. Put tent 4 on one side and the other three on the other, and lose every bird between them for the whole of what follows.Suppose some protocol did both. Put P4 on one side and the other three on the other, and lose every message between them for the whole of what follows.
  2. The first night. The plan stands at hold. Number 2 moves it to attack. Since every mercenary is answered, Number 2 is told it stands. Nothing else happens anywhere. Call the time this takes T, by the glass.The first execution. The value is 0. A client writes 1 at P2. Since every request is answered, the client is told the write took effect. Nothing else happens anywhere. Call the time this takes T, by the timer.
  3. The second night. The plan stands at hold. Nothing happens anywhere for at least T. Then Number 4 asks which plan stands, and is answered. Nobody moved it, so answering as one gives hold.The second execution. The value is 0. Nothing happens anywhere for at least T. Then a client reads at P4, and is answered. Nobody wrote, so acting as one copy gives 0.
  4. Put them together. Let the first night happen among the three and the second at tent 4, at the same time. The three cannot tell this from the first night, since nothing reaches them from tent 4 in either, so Number 2's move is made and answered as before. Because of the quiet time, Number 4 asks after Number 2's move was finished.Put them together. Let the first execution happen among the three and the second at P4, at the same time. The three cannot tell this from the first execution, since nothing reaches them from P4 in either, so the write is made and answered as before. Because of the waiting period, the read at P4 begins after the write finished.
  5. Number 4 cannot tell this from the second night. Number 4 began with the same note, the glass has run the same, and no bird has reached tent 4 in either. So Number 4 answers hold.P4 cannot tell this from the second execution. It began with the same copy, the timer has run the same, and no message has reached it in either. So P4 answers 0.
  6. But Number 2's move was finished before Number 4 asked, so it comes first in any order that answers as one, and a single record would have said attack. That contradicts the supposition.∎But the write was finished before the read began, so it comes first in any order that acts as one copy, and a single object would have returned 1. That contradicts the supposition.∎
Any two of the three

The muster-master's arrangementThe primary-copy protocol

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:

1 · Answering as one + Lost birds (CP)1 · Consistency + Partition tolerance (CP)

The muster-master's arrangementThe primary-copy protocol

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.

2 · Answering as one + Every mercenary (CA)2 · Consistency + Availability (CA)

The same arrangement, with no hawksThe same protocol, with no failures

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.

3 · Every mercenary + Lost birds (AP)3 · Availability + Partition tolerance (AP)

Each tent answers from its own noteEach node answers from its own copy

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.

Three nights Number 2 moves the plan to attack; Number 4 asks laterThree executions a client writes 1 at P2; a client reads at P4 later

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 muster-master's arrangement, stated formallyThe primary-copy protocol, stated formally
  1. One designated tent (Tent 1, the muster-master) holds the authoritative note of the standing plan.One designated node (P1, the primary) holds the authoritative copy of the value.
  2. A mercenary at any other tent completes a move or receives an answer to a question only when the muster-master's reply raven arrives.A client at any other node completes a write or receives a read’s answer only when the primary’s reply message arrives.
  3. The muster-master processes incoming ravens one at a time, in the order they arrive.The primary processes incoming messages one at a time, in the order they arrive.

The centralized algorithm, §3.2.1–3.2.2.

Proof · that the muster-master's arrangement answers as oneProof · that the primary-copy protocol acts as one copy

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.

  1. Order all moves and questions by the moment the muster-master dealt with them. This is one order, the same whichever tent the mercenary was at.Order all writes and reads by the moment the primary dealt with them. This is one order, the same whichever node the client was at.
  2. Every answer is the muster-master's, from the muster-master's one note in that order, so each is what a single record would say.Every answer is the primary’s, from the primary’s one copy in that order, so each is what a single object would return.
  3. The muster-master deals with a mercenary's business after it began, since the bird was sent then, and before it ends, since the answer waits for the muster-master. So each takes effect between its start and its answer, and anything finished before another began was dealt with first.∎The primary deals with a client’s request after it began, since the message was sent then, and before it ends, since the answer waits for the primary. So each takes effect between its start and its answer, and anything finished before another began was dealt with first.∎
A glass to waitA timeout

Waiting a glassWaiting out a timeout

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:

First

Start a glassStart a timer

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).

Second

The answer comes in 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.

Third

The glass runs out firstThe timer runs out first

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.

The glass earlier tonight Number 2 moved the plan to attackThe timeout earlier a client wrote 1

Number 4's glassP4’s timer

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.

Waiting a glass, stated formallyWaiting out a timeout, stated formally
  1. A mercenary who moves the plan or asks sends a raven to the muster-master and starts a sandglass lasting two flight times plus the muster-master's processing time.A client who writes or reads has its node send a request to the primary and start a timer lasting two delivery times plus the primary’s processing time.
  2. If the muster-master's reply arrives before the glass runs out, the mercenary uses that reply.If the primary’s reply arrives before the timer runs out, the node uses that reply.
  3. If the glass runs out first, the mercenary answers from their tent's local note: a question receives the latest plan received from the muster-master (unless the mercenary has made a local move since, in which case it receives that move), and a move is declared to stand.If the timer runs out first, the node answers from its local copy: a read receives the latest value received from the primary (unless the node has made a local write since, in which case it receives that write), and a write is declared to have taken effect.

A timeout of 2tmsg + tlocal, §4.3.

The damage ends

How stale, and for how long

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.

1 · Cut off

Number 4 moves the planA client writes at P4

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.

2 · Sent again

Until acknowledged, send it again

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.

3 · The hawks leave3 · The network recovers

One bird gets throughOne message gets through

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.

4 · The muster-master sends it round4 · The primary sends it round

Every tent learns the planEvery node learns the value

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).

5 · A span

No bird is lost for a spanNo message is lost for a 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.

6 · A question6 · A read

Anyone asking now hears attackAnyone reading now sees 1

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.

Two mercenaries move the plan the plan stood at attack, stamp 1Two clients write the value stood at 1, sequence number 1

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.

The promise of the span, stated formally

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:

  1. all moves are ordered among themselves, and every question is placed relative to every move;all writes are ordered among themselves, and every read is placed relative to every write;
  2. every question is answered with the plan of the last move before it in P, or hold if there is none;every read returns the value of the last write before it in P, or 0 if there is none;
  3. each mercenary's own business keeps its order in P;each client’s own operations keep their order in P;
  4. if no bird was ever lost, P answers as one;if no message was ever lost, P acts as one copy;
  5. and whatever happens, if something was finished, and then a span longer than t passed with no bird lost, and only then something else began, the first comes before the second.and whatever happens, if something was finished, and then a span longer than t passed with no message lost, and only then something else began, the first comes before the second.

Delayed-t consistency, Definition 3.

The muster-master's arrangement with a span, stated formallyThe primary-copy protocol with a span, stated formally

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.

Proof · that the muster-master's arrangement with a span keeps the promiseProof · that the primary-copy protocol with a span keeps the promise

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.

  1. The order. Order the moves by the muster-master's stamps; a move that never reaches the muster-master goes after all the stamped ones, in the order it was made. Place each question immediately after the move whose plan it was given, or at the start if it was given hold from dusk. Then every question is answered with the last move before it: clauses (1) and (2).The order. Order the writes by the primary’s sequence numbers; a write that never reaches the primary goes after all the sequenced ones, in the order it was made. Place each read immediately after the write whose value it returned, or at the start if it returned the initial 0. Then every read returns the value of the last write before it: clauses (1) and (2).
  2. Each mercenary's own order. A mercenary's moves reach the muster-master in the order they were made, since each bird carries all the earlier unacknowledged ones first; so the muster-master stamps them in that order, and has stamped them before answering that mercenary's question. A mercenary never answers with a lower stamp than one already held, and that mercenary's own unacknowledged moves are newer than anything the muster-master has sent. So each mercenary's questions land after that mercenary's earlier business: clause (3).Each client’s own order. A node’s writes reach the primary in the order they were made, since each message carries all the earlier unacknowledged ones first; so the primary sequences them in that order, and has sequenced them before answering that node’s read. A node never returns a value with a lower sequence number than one already held, and its own unacknowledged writes are newer than anything the primary has sent. So each client’s reads land after its earlier operations: clause (3).
  3. No bird lost. Then no glass runs out, every answer is the muster-master's, and this is the plain muster-master's arrangement, which answers as one: clause (4).No message lost. Then no timer runs out, every answer is the primary’s, and this is the plain primary-copy protocol, which acts as one copy: clause (4).
  4. A move, then a span. Suppose a move by Number 4 was finished, then more than t passed with no bird lost. In that span the move reaches the muster-master and the muster-master's stamp for it reaches every tent, each within half of t. So any move begun after the span gets a higher stamp, and any question begun after it is answered with this move or a later one.A write, then a span. Suppose a write at P4 was finished, then more than t passed with no message lost. In that span the write reaches the primary and the primary’s sequence number for it reaches every node, each within half of t. So any write begun after the span gets a higher sequence number, and any read begun after it returns this write or a later one.
  5. A question, then a span. The plan a finished question was given came from the muster-master or from a move of the asker's own. Either way, within the span that move is stamped and sent to every tent, and the last step places everything begun after the span later in P: clause (5).∎A read, then a span. The value a finished read returned came from the primary or from a write of the node’s own. Either way, within the span that write is sequenced and sent to every node, and the last step places everything begun after the span later in P: clause (5).∎

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.

Everything leaned on a known flightEverything leaned on a known delivery time

When the flight has no boundWhen delivery has no bound

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!

Mount Phyle at night seen from the sea: the dark mountain rising from the shore under the moon, the water still in front

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.

Two windy nights seen from tent 4Two executions seen from P4

One nightOne execution

Suppose a hawk takes the bird.Suppose the network drops the message.

Another nightAnother execution

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.

Proof · that in a wind, answering as one cannot even be promised when nothing is lostProof · that with unbounded delay, consistency cannot even be promised when nothing is lost

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.

  1. Suppose an arrangement answers every mercenary on every night, and answers as one on every night on which no bird is lost.Suppose a protocol answers every request in every execution, and acts as one copy in every execution in which no message is lost.
  2. By the Cut-Off Tent, which holds in a wind as well, there is a night on which a bird is lost and a wrong answer is given. It is given after only so much has happened.By the CAP theorem, which holds with unbounded delay as well, there is an execution in which a message is lost and a wrong answer is given. It is given after only so much has happened.
  3. Take that night up to the wrong answer. Let every bird that was lost instead be still in the pines, arriving afterwards; in a wind nobody can tell the difference. Continue the night so that every bird arrives.Take that execution up to the wrong answer. Let every message that was lost instead be still in transit, arriving afterwards; with unbounded delay nobody can tell the difference. Continue the execution so that every message arrives.
  4. On this night no bird is lost, and up to the wrong answer it is the same night, so the wrong answer is still given. That contradicts the supposition.∎In this execution no message is lost, and up to the wrong answer it is the same execution, so the wrong answer is still given. That contradicts the supposition.∎
Four questions

What being cut off does not sayWhat CAP does not say

Because the CAP theorem is so famous, it is often overstated. Four questions clarify its exact boundaries.

Is this the Chamber's impossibility?Is this the FLP impossibility?

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.

Is it about a dead mercenary?Is it about a crashed node?

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.

Does it cover everything the four know?Does it cover all data?

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.*

Must the four choose once for all?Must the choice be made once for all?

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

The papers behind this book

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.