CAP Theorem — Pick Two (But P Is Not Optional)
A distributed system can guarantee at most 2 of: Consistency, Availability, Partition Tolerance — and you can never drop P in a real network.
When to use (in design discussions)
- Choosing between CP (Zookeeper, HBase) vs AP (Cassandra, DynamoDB) systems
- Designing for partition survival in distributed deployments
Tradeoffs
- CP sacrifices availability during partitions; AP sacrifices consistency
- CA systems only exist on single-node setups (no real network partition handling)
| System | Consistency | Availability | Notes |
|---|---|---|---|
| Cassandra | Eventual | Always (AP) | Tunable consistency per-query |
| DynamoDB | Eventual | Always (AP) | Strong consistency opt-in, higher cost |
| ZooKeeper | Strong | Partial (CP) | Rejects writes without quorum |
| HBase | Strong | Partial (CP) | Built on HDFS + ZooKeeper |
| PostgreSQL (single-node) | Strong | High (CA) | No partition tolerance by design |
Gotcha: Partition tolerance is not optional in any real distributed network. The real choice is C vs A during a partition.