Understanding the CAP Theorem: Consistency, Availability, and Partition Tolerance
The article explains the origins of the CAP theorem, defines its three core properties, illustrates why a distributed system can satisfy at most two of them, discusses practical workarounds such as eventual consistency, and provides references for further study.
1. What is the CAP Theorem
In 2000, Professor Eric Brewer proposed the CAP conjecture, and two years later Seth Gilbert and Nancy Lynch formally proved its feasibility, establishing the CAP theorem as a foundational principle in distributed computing.
The CAP theorem states that a distributed system cannot simultaneously guarantee Consistency (C), Availability (A), and Partition tolerance (P); at most two of these properties can be satisfied.
What is a partition?
In a distributed system, nodes are spread across different sub‑networks; when network failures isolate some nodes while their internal sub‑networks remain functional, the overall system is split into isolated regions, which is called a partition.
2. Why Only Two of the Three Can Be Achieved
Can a system satisfy all three properties simultaneously?
Consider a system composed of two nodes (A and B) that must update each other atomically. When node A updates its database, node B must also update to maintain consistency. The system must also remain available, and it must tolerate network partitions.
During a partition, node A cannot communicate with node B, breaking the atomic update requirement. Enforcing strong consistency would require halting service, sacrificing availability. Therefore, only two of the three guarantees can be met.
3. Can the Trade‑Off Be Mitigated?
Is there a way to overcome the 3‑choose‑2 limitation?
The CAP theorem has been around for over a decade, prompting various strategies. If partitions never occur, all three properties could be satisfied. When partitions do occur, systems can relax consistency—e.g., using eventual consistency—by temporarily storing writes and reconciling later.
This line of thinking leads to broader models such as the BASE theorem, which are explored in subsequent articles.
4. References
“From Paxos to Zookeeper – Distributed Consistency Principles in Practice” by Ni Chao
“CAP Theory Twelve‑Year Review: The Rules Have Changed”
Wikipedia entry on the CAP theorem
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.