CSE Roadmap

Specialist tier · about 2 hours · 5 parts

Part 2 of 5 · 2 min read

What CAP actually says

During an actual network partition, a system must choose between staying available with possibly stale data, or staying consistent by refusing some requests.

Think of two offices of the same company briefly losing their connection to each other. Each office can keep serving its own customers using only its own local information. Or each office can refuse new requests entirely until the connection is restored and the offices can compare notes.

In plain words: the CAP theorem states that during an actual network partition, a distributed system holding replicated data must choose between consistency, every read seeing the most recent write, and availability, every request receiving a response. It cannot have both at once, because satisfying consistency during a partition would require nodes to communicate with other nodes they currently cannot reach, while satisfying availability means responding anyway, using only locally available, possibly outdated data. The theorem specifically applies to this one condition, during an actual partition, and says nothing directly about how the system behaves the rest of the time.

A worked example. Two replicas of the same data become unable to communicate due to a network partition. A client asks one of them for the current value. That replica must either respond with its own possibly stale local copy, choosing availability, or refuse to respond until it can confirm with the other replica, choosing consistency.

The key lines. No new SQL; the CAP theorem is a statement about a system's architecture and behavior during a partition, not something expressed in a query.

CAP theorem

The CAP theorem states that during an actual network partition, a distributed system holding replicated data must choose between consistency, every read seeing the latest write, and availability, every request getting a response, and cannot fully provide both at once.

Example: two offices cut off from each other choosing to either serve customers locally with possibly stale information, or refuse requests until reconnected, is exactly the CAP trade-off.