- CAP theorem states that a distributed system can only guarantee two out of three:
- Consistency – Every read returns the latest write.
- Availability – Every request gets a response (even if it’s not the latest).
- Partition Tolerance – System works even if there’s a network failure between nodes.
- You must sacrifice one in the presence of a network partition.
- Common trade-offs:
- CP: Consistency + Partition Tolerance (e.g., HBase)
- AP: Availability + Partition Tolerance (e.g., Cassandra)
- CA is not possible in distributed systems with partitions.