System Design · Architecture under constraints
What does the CAP theorem actually say?
Short answer
During a network partition, a distributed system must give up either linearizable consistency or availability. CAP is about a partition, not a permanent choice of two from three.
CAP names three properties: consistency, meaning linearizability; availability, meaning every request to a non-failing node receives a non-error response; and partition tolerance, meaning the system continues despite dropped messages between nodes. Networks partition, so the real choice is what to do while a partition exists.
If two nodes cannot communicate, a write on one side cannot be seen by the other. To stay consistent, the system must reject or block some requests, which sacrifices availability. To stay available, it must accept divergent state, which sacrifices consistency. Claiming a CA system is misleading unless the system never experiences partitions, which is unrealistic for a distributed deployment.
CP versus AP in practice
- CP systems favor a consistent view: a minority partition may refuse writes or reads
- AP systems favor serving requests: replicas may diverge and reconcile later
- Most systems are tunable per operation rather than globally CP or AP
- Even a CP system must decide how long to wait before giving up, so latency is part of the choice
PACELC extends the idea: if there is a partition, choose availability or consistency; else, choose latency or consistency. That second half matters because synchronous replication and quorum reads cost latency even when the network is healthy. A product may accept eventual consistency to keep p99 low.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why is CA misleading for a distributed database?
- 2How does PACELC extend CAP?
- 3How would you apply CAP to a payment versus a like counter?
- 4Does CAP say anything about latency without a partition?
Say it in the interview
CAP says that when a network partition occurs, you cannot guarantee both linearizable consistency and availability, so you choose which to sacrifice for that operation. It is not a permanent two-out-of-three selection, because partitions are a fact of distributed systems. I use PACELC to remember the healthy-network trade-off between latency and consistency. In practice I decide per operation, such as strong consistency for payments and eventual consistency for counters.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live System Design mock interview and get scored feedback on depth, clarity and confidence.