All topicsTopic 20 / 24
Intermediate 1 minute
CAP Theorem
CAP theorem says that during a network partition, a distributed system must choose between consistency and availability for the affected operation. A partition means nodes cannot reliably communicate; it is not an optional product setting. Systems make different choices by feature: a checkout may reject uncertain writes, while a feed may serve a slightly stale response and stay available.
Key idea
CAP trade-offs become unavoidable when communication between nodes breaks.
See it in one picture
Follow the arrowsConsistency
Availability
Partition
When the network breaks, a trade-off appears
Real-world example
If two regions lose their connection, a payment system may pause writes to avoid double spending. A news feed may keep serving cached posts in both regions and reconcile later.
Quick check