CAP Theorem
When a network splits a distributed system, it can stay consistent or stay available, but a proven theorem says not both.
The CAP theorem states that a distributed data system experiencing a network partition must choose between consistency and availability — it cannot guarantee both at once. Consistency here means every read sees the most recent write; availability means every request gets a non-error response; partition tolerance means the system keeps functioning despite dropped or delayed messages between nodes. Since a network can always partition, the real choice CAP describes is what happens during one: refuse to answer until the split heals (favor consistency), or answer anyway with possibly stale data (favor availability).
This is easy to overstate, and CAP's original 2000 conjecture has been refined since precisely because of that. Outside of an actual partition — the overwhelmingly common case for most systems most of the time — there's no forced tradeoff at all; a system can be both consistent and available as long as its nodes can talk to each other. CAP only bites during the partition itself, and it says nothing about latency, which is where most of the practical engineering tension actually lives (the related PACELC formulation makes that explicit: partition or not, a system also trades latency against consistency).
In practice, systems pick a lean rather than an absolute: a leader-based replicated relational database favors consistency, rejecting or stalling writes rather than risk serving stale reads if it can't reach a quorum; a system like DNS or a shopping cart favors availability, always answering and reconciling any conflicting writes later — the same reconciliation problem Eventual Consistency and CRDTs exist to solve.
See also3
Eventual Consistency
A guarantee that replicas converge given no further updates, without guaranteeing when.
Networks & Distribution22 connections
Database Replication
Copying the same data to multiple database nodes for redundancy and read scale, at the cost of a lag window.
Data & Content13 connections
Consensus Algorithm
A protocol that gets a majority of unreliable, independent nodes to agree on one value, surviving any minority failing.
Data & Content7 connections
Related1
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from9
- ACIDData & Content
The four guarantees a transactional database makes so concurrent, interrupted work never leaves data half-done.
- Chaos EngineeringTesting & Verification
Deliberately breaking parts of a running system to prove it survives failures that will eventually happen anyway.
- Consensus AlgorithmData & Content
A protocol that gets a majority of unreliable, independent nodes to agree on one value, surviving any minority failing.
- Database ReplicationData & Content
Copying the same data to multiple database nodes for redundancy and read scale, at the cost of a lag window.
- Database ShardingData & Content
Splitting one dataset across multiple databases by key, trading a single point of scale for cross-shard complexity.
- Isolation LevelData & Content
How much concurrent transactions are allowed to see of each other's unfinished work, a dial between correctness and speed that most databases set lower than people assume.
- Leader ElectionData & Content
The process a distributed system uses to pick one node to coordinate, and to notice and replace it when it dies.
- Network PartitionNetworks & Distribution
A network failure that splits a cluster into groups that can't reach each other but keep running, and the split brain that follows when each side thinks it is in charge.
- Two-Phase CommitData & Content
A protocol for committing one transaction across multiple databases atomically, at the cost of blocking if the coordinator dies.