What it is
PACELC is Daniel Abadi’s extension of CAP (blog post 2010, IEEE Computer article 2012). It reads as a sentence:
If there is a Partition, choose between Availability and Consistency; Else (normal operation), choose between Latency and Consistency.
A system is described by two choices, for example PA/EL (available during partitions, low latency otherwise) or PC/EC (consistent in both cases).
Why it exists
CAP is often over-applied. It only constrains a system during a partition, which is a rare event, and it says nothing about the cost of consistency on an ordinary day. Yet many designs that “chose availability” did so for latency, not partitions: as soon as data is replicated, keeping the copies in agreement before answering requires communication, and communication takes time. PACELC names that everyday trade-off.
How it works
Why the else-branch exists. A write that must be visible on every replica before it is confirmed has to reach them (and, in real protocols, be acknowledged). That costs at least one round trip to the replicas you wait for. Consensus protocols wait for a majority, which is the fastest majority but still a round trip. Answering without waiting is fast but means replicas temporarily miss a confirmed write.
The two knobs.
- Synchronous (or quorum) replication: confirm after the replicas (or a majority) have the write. Reads on those replicas see it. Write latency includes the round trip to the slowest replica you wait for.
- Asynchronous replication: confirm after the local write, replicate afterwards. Writes are as fast as one node allows; replicas lag by at least the one-way trip plus apply time, and reads there can be stale.
Distance is the price list. Light in optical fibre travels at about 200,000 km/s, roughly 200 km per millisecond, and real routes are longer than straight lines. Within one availability zone a round trip is well under a millisecond; between zones of a region, typically a millisecond or two; between continents, tens to well over a hundred milliseconds. Moving a replica farther away increases the latency of waiting for it and the staleness of not waiting.
Middle grounds.
- Semi-synchronous replication: wait for one replica (usually a nearby one) and replicate to the rest asynchronously.
- Quorums: wait for W of N replicas on write and read R of N, with R + W > N so reads overlap the latest write (with caveats covered in the strong-consistency lesson).
- Per-operation consistency: Cassandra-style consistency levels, MongoDB read and write concerns, DynamoDB’s choice between eventually and strongly consistent reads, follower reads with a bounded staleness in some distributed SQL databases.
- Home regions: keep each record’s authoritative copy in one region (near its users), with synchronous replication inside the region and asynchronous copies elsewhere.
Classifying systems. Abadi’s 2012 examples: Dynamo, Cassandra and Riak (default settings) are PA/EL; VoltDB/H-Store, Megastore and BigTable/HBase are PC/EC; MongoDB (at the time) PA/EC; Yahoo’s PNUTS PC/EL. These describe defaults; configuration often moves a system to another quadrant, so describe the configuration, not the product.
When to use it
Use PACELC whenever you place replicas or choose a replication mode: deciding whether a standby is synchronous, whether reads may go to followers, how far apart regions are, which consistency level each query uses. It is particularly useful in multi-region designs, where the else-branch costs tens of milliseconds per write.
When not to
For a single-node database, or replicas used only for failover that never serve reads and accept the risk of losing the last few writes, the latency/consistency question mostly reduces to durability on failover. PACELC also does not replace thinking about specific consistency models: “C” here is a family (linearizable, sequential, causal...), not a single setting.
Trade-offs
| Configuration | Normal operation | During a partition | Typical use |
|---|---|---|---|
| Async replicas, read anywhere (PA/EL) | Fast writes, stale reads | Stays available, diverges | Feeds, catalogues, analytics |
| Sync or quorum replication, leader reads (PC/EC) | Slower writes, consistent reads | Minority side unavailable | Payments, inventory, metadata |
| Sync within a region, async across regions | Local-speed consistent writes; remote readers lag | Per region | Most multi-region OLTP |
| Per-request consistency levels | Pay only where needed | Per request | Mixed workloads |
Alternatives
- CAP alone: enough to reason about failure behaviour, silent on everyday cost.
- Consistency-model hierarchies (linearizable → sequential → causal → session guarantees → eventual) give finer choices than “C or L”.
- Bounded staleness (“at most 10 s or 100 versions behind”) turns the else-branch into a tunable number.
Failure modes
- Synchronous replica becomes the latency floor. A slow or distant synchronous replica slows every write; a dead one can block writes unless the system drops it from the synchronous set.
- Invisible staleness. Async lag does not show up in latency or error dashboards; it surfaces as user-visible bugs (“I saved it and it is gone”).
- Lost writes on failover. Promoting an async replica loses the writes it had not received.
- Accidental cross-region chatter. A “local” read that has to consult a leader in another region quietly adds a cross-continent round trip.
In production
Measure replication lag per replica and alert on it. Keep synchronous replicas close (same region, different zones) and remote ones asynchronous. Route reads that must see the user’s own writes to the leader or to a replica known to be caught up (pass the write’s log position or a timestamp). Set consistency levels per query rather than globally, and document which operations need which. Load-test with realistic inter-region latency, not a local network.
Common misconceptions
- “We don’t have partitions, so CAP doesn’t affect us.” The latency/consistency trade-off affects you every day.
- “Async replication is free.” It costs staleness and possible data loss on failover.
- “Faster hardware removes the cost of synchronous replication.” The round trip dominates; disks and CPUs don’t shorten it.
- “A system has one PACELC label.” Configuration and per-request settings move it between quadrants.
Interview angle
After stating CAP, add: “and in normal operation, PACELC: latency versus consistency.” Then put numbers on it: a cross-region synchronous write costs at least one round trip (say 70–150 ms intercontinental), so you keep synchronous replicas within a region and replicate asynchronously across regions, routing read-your-writes traffic to the home region. Naming per-operation consistency levels shows you know real systems are not one quadrant.
Model assumptions
The simulation is a simplified model, not a benchmark. Region 1’s app sends 80 requests per second (30% writes over 50 keys, Zipf 1) through a database proxy that sends writes to the primary and reads to a local replica (2 ms away); Region 2 sends 60 reads per second to Replica 2, 60 ms away (150 ms in later steps). Each database has 16 connections, 5 ms reads and 8 ms writes. Synchronous means the primary confirms once every replica has applied the write (8 ms) and its acknowledgement has travelled back, so a write waits for the farthest replica's full round trip, and keeps its primary connection while it waits. This is not a network-partition model: the "partition" step blocks replication by delaying it by ten minutes (the link is not cut and the nodes stay up); the primary gives up waiting after 2.5 s and the clients after 2 s. Real databases differ (PostgreSQL waits for the standby, MySQL semi-sync falls back to async after a timeout). Stale reads are replica reads that miss a write the primary already confirmed. Clients give up after 2 s. Numbers show behaviour and orders of magnitude only.
How to read this demonstration.
- Actual engine simulation: asynchronous and synchronous replication across distances (60, 150 and 25 ms), write latency including the acknowledgement's way back, stale reads in Region 2, client timeouts, and the blocked-replication step.
- Scripted animation: none: every step is simulated.
- Hybrid demonstration: none.
- Simplified model: fixed distances and apply times; staleness is a read that misses a write the primary already confirmed; 'partition' means replication is blocked by a delay, no link is cut.
- Time compression: slow motion (about 0.1 times real time); the ten-minute replication delay outlasts the step.
- Not supported by the simulation: network partitions as such, consensus or quorum systems, per-operation consistency levels, read-your-writes routing.