Articles
PACELC Theorem Explained: The Trade-off CAP Doesn't Tell You About
Apply PACELC per operation by separating partition-time availability versus consistency from normal latency versus consistency.
PACELC extends the consistency conversation beyond network failures. It asks two separate questions. If a partition occurs, does the system favor availability or consistency? Else, while communication is healthy, does it favor lower latency or stronger consistency?
For a Backend Engineer, the framework is most useful as a checklist. First describe partition behavior. Then describe the normal read and write path. Keep the two regimes separate, state the consistency guarantee you actually need, and classify operations rather than assigning one label to an entire product.
Start with two regimes, not four letters
PACELC can be read as a conditional:
if a network partition prevents some replicas from communicating:
trade availability against consistency
else:
trade latency against consistency
The letters are shorthand, not a complete database specification. “Consistency” can mean linearizability, causal consistency, read-your-writes, monotonic reads, or another contract. “Latency” depends on topology, leader placement, quorum size, congestion, and tail behavior. State those assumptions before classifying a design.
| Question | What to specify |
|---|---|
| What counts as a partition? | Which nodes or regions cannot communicate, and for how long |
| Which consistency guarantee matters? | Linearizable write order, read-your-writes, causal order, or bounded staleness |
| Which operation is being classified? | Read, write, compare-and-set, search, analytics, or another path |
| What does unavailable mean? | Error, timeout, read-only mode, or a restricted subset of operations |
| What latency matters? | Local median, cross-region round trip, or tail latency at a stated percentile |
During a partition, make the CAP choice explicit
CAP consistency is commonly modeled as linearizability: operations appear to occur in one real-time order. CAP availability requires every request received by a non-failing node to eventually receive a non-error response. When a partition prevents groups of replicas from communicating, a system cannot guarantee both for the same operation.
Suppose two regions both receive a request to reserve the last seat while they cannot communicate.
Consistency-favoring behavior: only the side that can reach the authoritative leader or quorum may commit. The other side rejects or times out. The system preserves one order of seat assignments, but some valid requests receive no successful answer.
Availability-favoring behavior: both sides accept writes. Each region remains responsive, but the histories can diverge. When communication returns, the system needs conflict detection and a domain-specific resolution. “Last writer wins” may silently discard a reservation and is usually unacceptable for scarce inventory.
Partition behavior can vary by operation. A system may stop inventory writes, continue serving cached catalog reads, and buffer analytics events locally. “CP” or “AP” for the whole application hides that useful distinction.
Choosing availability creates an engineering obligation: version conflicting writes, repair divergent replicas, and define a merge that matches the domain. Choosing consistency creates another obligation: fence old leaders, expose clear failure states, and recover without allowing split-brain writes.
In normal operation, price coordination
When the network is healthy, the system still chooses how much coordination sits on each request path.
| Mechanism | Consistency benefit | Latency cost or constraint |
|---|---|---|
| Read from the nearest replica | Low latency and geographic locality | May return a stale value |
| Read from the leader | One ordered source for that key | Leader location controls latency and load |
| Synchronous replica acknowledgment | Acknowledged writes exist on several replicas | Write waits for replica round trips |
| Asynchronous replication | Fast local acknowledgment | Replicas lag; failover may lose an unshipped tail |
| Read quorum | Overlaps more replicas and can improve freshness | Adds network work and tail-latency exposure |
| Session token or sticky routing | Read-your-writes for one client | Weaker than global linearizability |
Quorum arithmetic is useful but easy to overstate. With N replicas, a read quorum R and write quorum W overlap when R + W > N. For N = 3, R = 2 and W = 2 guarantee that the two sets share at least one replica.
That overlap alone does not prove full linearizability. Concurrent writes still need ordering and conflict rules. Sloppy quorums can write to temporary replicas outside the normal set. Failed writes may reach only some replicas. A strong answer names the versioning and coordination assumptions rather than treating R + W > N as a universal proof.
The latency-consistency choice is also relative, not absolute. A strongly consistent read from a nearby leader may be fast. An eventually consistent replica under overload may be slow. PACELC says coordination and locality create a trade-off; it does not predict a latency number without the topology and workload.
The relationship between synchronous acknowledgment and background replication is developed further in the synchronous versus asynchronous guide.
This conference talk focuses on the normal-operation latency and consistency trade-off that PACELC adds to CAP:
Video: Latency and Consistency Tradeoffs in Modern Distributed Databases
Apply PACELC per operation
Consider a global travel service. Search, booking, profile updates, and analytics do not need one consistency posture.
| Operation | During a partition | During normal operation | Reason |
|---|---|---|---|
| Search cached routes | Keep serving available replicas | Prefer local low-latency reads with bounded staleness | Search can be revalidated later |
| Reserve a scarce seat | Reject where authority or quorum is unreachable | Coordinate through one leader or quorum | Double-selling is harder to repair than a failed request |
| Update display preferences | Accept locally if conflicts can merge | Prefer local acknowledgment and read-your-writes | A merge policy can resolve low-risk conflicts |
| Record analytics | Buffer or accept on reachable nodes | Batch and replicate asynchronously | Delay is acceptable; loss policy must be explicit |
A concise design explanation for seat booking might be:
During a partition, only the side that can reach the flight’s write authority may confirm a seat. The other side returns a retryable failure. In normal operation, writes are synchronously ordered for that flight, and the booking path accepts the coordination latency because two successful claims on one seat are not safely mergeable. Search remains separately available from replicated caches and revalidates inventory before checkout.
This answer works because it covers both PACELC regimes, scopes the decision to one operation, and connects the technical choice to the failure cost.
Use the following checklist for a new design:
- Identify the operation and the consistency guarantee it needs.
- Describe what each partitioned side is allowed to return or commit.
- Describe leader, quorum, or replica behavior while communication is healthy.
- State the latency path, including cross-region coordination if present.
- Explain divergence repair for availability-favoring writes.
- Explain fencing and failure responses for consistency-favoring writes.
- Reclassify other operations instead of applying one label globally.
PACELC does not select a database by itself. Data model, query shape, operational maturity, and scale still matter. Use the SQL versus NoSQL guide for that broader choice, the DynamoDB design guide for concrete access-pattern constraints, and sharding and partitioning when data placement becomes the main concern.
FAQ
Does CAP mean “pick any two of three”?
No. CAP describes what can be guaranteed for an operation while a network partition prevents required communication. Under that condition, linearizable consistency and CAP availability cannot both be guaranteed.
Is eventual consistency always the low-latency choice?
No. It often removes coordination from the critical path, but actual latency depends on locality, load, and implementation. State the topology and compare concrete read or write paths.
Does a consistency-favoring system stop completely during a partition?
Not necessarily. It may reject writes only on the side without authority, continue reads, or keep unrelated partitions of data available. Classify the specific operation and shard.
Is R + W > N enough for linearizability?
No. It guarantees quorum overlap under its assumptions. Linearizability also needs ordered versions, correct handling of concurrent and failed writes, and a protocol that prevents stale replicas from winning.
Can one application occupy several PACELC categories?
Yes. Search, payment, inventory, profiles, and analytics often use different consistency and latency contracts. Per-operation classification is usually more accurate than one label for the application.