data-infra

CAP Theorem

The CAP theorem states that when a distributed system is partitioned — some nodes can't talk to others due to a network failure — you must choose between consistency (every read sees the latest write) and availability (every request still gets an answer). You cannot have both during a partition. Since partitions are inevitable at scale, CAP is really a forced choice between CP and AP behavior when the network breaks. A CP system refuses requests it can't answer correctly rather than return stale data; an AP system keeps answering, accepting that replicas may temporarily disagree and reconcile later (eventual consistency). For SaaS builders, CAP is a lens for reading your database's guarantees: a banking ledger leans CP, a shopping cart or social feed usually leans AP. Practical note: CAP only bites during a partition — the rest of the time you can have both — and most real systems tune this per-operation rather than picking one globally.

Related terms

More Data & Infra terms