The CAP Theorem is a foundational concept in distributed systems, stating that a distributed system can only guarantee two out of three properties: Consistency, Availability, and Partition Tolerance. This article explains each property and emphasizes that Partition Tolerance is unavoidable in modern distributed environments, forcing architects to choose between Consistency and Availability during network partitions. It highlights how different database systems make these crucial trade-offs and the practical implications for system design decisions.
Read original on Dev.to #systemdesignThe CAP Theorem, proposed by Eric Brewer, defines a fundamental limitation for distributed systems: they cannot simultaneously guarantee Consistency (C), Availability (A), and Partition Tolerance (P). In practice, since network partitions are inevitable in real-world distributed environments, the true choice lies between Consistency and Availability when a partition occurs.
Why Partition Tolerance is Mandatory
Network partitions are not hypothetical; they are a certainty in distributed systems due to network outages, region failures, router issues, or infrastructure maintenance. Therefore, modern distributed systems must be designed to be partition-tolerant, leaving the architect to choose between strong consistency and high availability during a partition event.
When a network partition occurs, a system must make a choice between prioritizing consistency or availability:
| Database | Typical Preference |
|---|