How it works
CAP is often summarized as “pick two of consistency, availability, and partition tolerance.” That wording misleads, because you cannot opt out of partitions: cables get cut, switches fail, and processes stall long enough to look gone. The real statement is narrower. While a partition lasts, a node that cannot reach its peers can refuse the request, keeping answers linearizable, or answer anyway, staying available but perhaps stale. When the network is healthy, you can have both.
The terms are narrow too. Consistency here means linearizability only. Availability means every working node answers every request, which majority-based systems give up even though most clients keep working. Take three regions running one such store, with region C cut off at 14:00. A and B still form a majority and keep selling seats. A purchase reaching C is refused, so buyers routed there see errors until traffic moves. Had C sold on its own, two buyers could own seat 14, and someone would have to refund and apologize.
The choice need not be global. An app can refuse purchases during a partition and still serve a slightly stale seat map. Cassandra exposes this per query through consistency levels such as ONE and QUORUM.
Partitions are rare, and a daily tradeoff is easier to miss. With an example round trip of 80 ms between regions, a synchronous write pays about 80 ms, while an asynchronous one returns in a few milliseconds but can lose recent data if that region fails. CAP does not describe this tradeoff; the PACELC framing adds it.
Your ticketing site runs in two regions, and the link between them may fail during a sale. You can stop selling in the region that loses contact with the leader, or give each region its own reserved block of seats in advance. Which do you choose?
Reserved blocks keep both regions selling without conflict, because each owns a separate set of seats and a partition cannot cause a double sale. The cost is stranded inventory: one region can sell out while the other has seats left, and buyers cannot pick any seat in the house. Stopping sales in one region keeps every seat selectable but loses sales there until traffic moves or the link returns. For assigned seating I would refuse; for interchangeable general-admission places I would divide.
Use this as a guide for self review; written answers are not graded.Keep in mind
- You cannot opt out of partitions; you choose what a cut-off node does.
- CAP’s consistency means linearizability, and its availability is stricter than everyday uptime.
- Without a partition, the everyday tradeoff is latency against freshness.