CAP Theorem
During a network partition a distributed store must choose consistency or availability, not both.
The CAP theorem states that when the network partitions, a system can keep data consistent (every read sees the latest write) or stay available (every request gets a response), but not both. It frames the core trade-off of every distributed database.
Worked example: two data centers lose their link mid-transaction. A CP store (a bank ledger) refuses the withdrawal until it can confirm the latest balance — consistent but unavailable; an AP store (a shopping cart) accepts the write on whichever side you hit and reconciles later — available but possibly stale. Gotcha: CAP only forces the choice during a partition — the rest of the time you get both. The trade you actually make every day is latency vs consistency (the “PACELC” extension), since even without a partition, stronger consistency costs coordination round-trips.