In CAP, why is partition tolerance not really a choice?
Network partitions happen in any real distributed system, so you cannot opt out of P. The real decision is what to do during a partition: refuse some requests to stay consistent (CP) or answer with possibly stale data (AP).
Explain it simply
CAP says a distributed store cannot give all three of consistency, availability and partition tolerance at once. Students often read it as "pick any two", which misleads.
A partition means some nodes cannot talk to others, for example a cable cut between two data centres. On a single machine this never occurs, but once data lives on several machines across a network, links will fail sometime. So partition tolerance is not optional; you are always P.
The meaningful question is: while the partition lasts, what does each side do?
- CP: the side that cannot confirm the latest data rejects or delays requests. Correct but sometimes unavailable.
- AP: each side keeps answering from what it has. Available but may return stale or diverging data, to be merged later.
When there is no partition, you can have both C and A.
Example
Two data centres, Mumbai and Chennai, hold a seat count. The link between them breaks.
CP choice: Chennai cannot reach Mumbai, so it refuses bookings.
No double booking, some users see errors.
AP choice: both keep selling seats.
Everyone is served, but the same seat may be sold twice
and must be fixed after the link returns.What to say in the interview
"Partitions are a fact of networks, so CAP really asks what we sacrifice during one. CP systems preserve correctness and reject some requests; AP systems stay up and reconcile later. I choose per feature: CP for payments and booking, AP for feeds and carts."
Common mistakes
- Describing CAP as a permanent pick-two label with no partition involved.