Three properties
The CAP theorem describes a distributed data store using three properties:
- Consistency means every read sees the most recent write.
- Availability means every request gets a non error response.
- Partition tolerance means the system keeps working even when the network drops messages between nodes.
The real choice
Networks fail, so partition tolerance is not optional for a real distributed system. The theorem says that during a partition you must choose between consistency and availability.
- A CP system refuses or blocks requests it cannot serve correctly, sacrificing availability to avoid stale or conflicting data.
- An AP system keeps answering on both sides of the split, sacrificing consistency and reconciling later.
Beyond the partition
When the network is healthy a system can offer both. The trade also has a latency dimension: even without a partition, stronger consistency usually costs more coordination and therefore more delay. Many real systems tune consistency per operation rather than picking one global mode.
Key idea
When the network splits you must choose between answering every request and never returning stale data.