What CAP actually says
Two friends share a paper calendar for booking a meeting room, each keeping a copy, and they phone each other to sync every booking. One day the phone line is down. Someone asks Ana to book the room for 3 pm. Ana can:
- refuse (“I can’t confirm right now, try later”), so the calendars never disagree, or
- accept the booking, knowing that Marko might be booking the same slot for someone else at this very moment.
That’s the whole theorem. The three letters:
- Consistency: every read sees the latest write, as if there were only one copy.
- Availability: every request to a working server gets a (non-error) answer.
- Partition tolerance: the system keeps working when the network between servers fails.
Brewer’s conjecture, proved by Gilbert and Lynch (2002): an asynchronous networked system with replicated data cannot simultaneously guarantee linearizability (C), availability of every non-failing node (A) and tolerance of arbitrary message loss between nodes (P). Since partitions happen in any real network, the meaningful reading is: when a partition occurs, each operation either sacrifices linearizability or sacrifices availability on at least one side. CAP says nothing about behavior without partitions, about latency, or about weaker consistency models (causal and session guarantees remain achievable while available), and the C and A are much stricter than the everyday meanings of “consistent” and “up”.
Situation: replicas EU and US can't reach each other. A client in the EU writes x = 2 (was 1).
Then a client in the US reads x.
CP behavior (choose consistency):
EU write → refused or blocked: can't reach a majority / the leader is on the other side
US read → x = 1 is the last confirmed value; or refused if the US side can't confirm it's current
Result: nobody sees conflicting data; some requests get errors or wait
AP behavior (choose availability):
EU write → accepted locally: x = 2
US read → answered locally: x = 1 (stale)
US write → accepted locally: x = 3 (now a conflict)
Result: everyone gets answers; the copies disagree until the partition heals and they reconcile- “Pick two of three” is misleading. You can’t choose to give up P: networks fail whether you like it or not. The real choice is what to do when they do: refuse (CP) or answer with possibly stale data (AP).
- When the network is fine, a well-built system can be both consistent and available. CAP is about the bad minutes, not every second.
- A mobile app offline is a partition too: the app either refuses to act until it’s online (CP) or lets the user act and syncs later (AP).
Predict the output
A CP database runs 5 replicas: 3 in Frankfurt, 2 in Virginia. The transatlantic link fails. What do clients in Virginia get when they try to write?
A CP system (one using consensus, like etcd, ZooKeeper, Spanner or CockroachDB) commits a write only with a majority of replicas. Frankfurt still has 3 of 5 and keeps working; Virginia has 2 of 5, so its writes (and linearizable reads) fail until the link heals. The minority side gives up availability so the data never diverges. Where you place replicas decides which side keeps working.
- Partitions are inevitable; CAP = under partition, each operation gives up linearizability or availability (on some side).
- CAP’s C is linearizability and its A is “every non-failing node answers”: both stricter than everyday usage. It says nothing about the no-partition case or latency.
- Consensus systems are CP: the minority side loses writes and linearizable reads. Replica placement decides who stays up.
- Weaker models (causal, session) remain achievable while available.
Check this part
Why is "pick two of C, A and P" misleading?
During a partition, what does an AP system do?
In a 5-replica consensus cluster split 3/2, which side keeps accepting writes?