⚖️ Reading: System Design Trade-offs — CAP Theorem
3 exercises — read a technical article about the CAP theorem and distributed database trade-offs. Practice understanding the language of system design: consistency, availability, partition tolerance, and tunable guarantees.
System design reading essentials
- CAP → Consistency, Availability, Partition tolerance — pick 2; P is non-negotiable in real systems
- CP → refuses requests during partition to stay correct (e.g. HBase, ZooKeeper)
- AP → serves stale data during partition to stay available (e.g. Cassandra, CouchDB)
- Eventual consistency → data converges over time; not a flaw for many use cases
- Tunable consistency → choose the trade-off per query, not per database
0 / 3 completed
1 / 3
System Design Trade-offs — CAP Theorem
{ex.passage} The article states: "In practice, network partitions are unavoidable in any real distributed system." What does this mean for the CAP theorem's three-way choice?
CAP in practice: the real choice is C vs A
The CAP theorem says you can have at most two of: Consistency, Availability, Partition tolerance. This sounds like three options (CA, CP, AP). But the article makes a crucial point: partition tolerance is non-negotiable in any real distributed system.
Why? Networks fail. Routers drop packets. Data centres lose connectivity. Cloud providers have zone outages. A distributed system that assumes a perfect network will fail catastrophically when — not if — the network misbehaves. Giving up P means your system becomes a single node (no distribution at all).
The real choice collapses to:
Vocabulary note: "Partition" in distributed systems means a network split — two or more groups of nodes cannot communicate with each other. It is NOT about database table partitioning. Context determines the meaning.
The CAP theorem says you can have at most two of: Consistency, Availability, Partition tolerance. This sounds like three options (CA, CP, AP). But the article makes a crucial point: partition tolerance is non-negotiable in any real distributed system.
Why? Networks fail. Routers drop packets. Data centres lose connectivity. Cloud providers have zone outages. A distributed system that assumes a perfect network will fail catastrophically when — not if — the network misbehaves. Giving up P means your system becomes a single node (no distribution at all).
The real choice collapses to:
- CP (Consistency + Partition tolerance): When a partition occurs, refuse to serve requests rather than risk returning stale data. The system becomes temporarily unavailable to preserve data correctness. Example: a banking ledger must never show a balance that hasn't been confirmed across all nodes.
- AP (Availability + Partition tolerance): When a partition occurs, continue serving requests even if some nodes have stale data. Eventually the data converges when the partition heals. Example: a social media feed can show posts from a few minutes ago without causing real harm.
Vocabulary note: "Partition" in distributed systems means a network split — two or more groups of nodes cannot communicate with each other. It is NOT about database table partitioning. Context determines the meaning.