liveBook · Manning

PACELC theorem

As explained in The Coder Cafe

The PACELC theorem extends CAP by stating that a distributed system chooses between consistency and availability during a partition, and between latency and consistency when no partition occurs.

PACELC is a way to compare distributed database trade-offs. CAP asks what happens when a network partition prevents nodes from communicating. PACELC adds a question for normal operation: how much latency is a system willing to accept for consistency? section 6.2 section 6.3

The name describes two separate decisions:

  • If a partition occurs (P), favor availability (A) or consistency (C). An available node may keep responding with outdated data. section 6.3 section 6.2
  • Else (E), when there is no partition, favor low latency (L) or consistency (C). section 6.3

Combining the decisions gives four possible designs:

  • PA/EL favors availability during partitions and low latency otherwise; Amazon DynamoDB is an example. section 6.3
  • PC/EC favors consistency during partitions and in normal operation; CockroachDB is an example. section 6.3
  • PA/EC favors availability during partitions but consistency when the network is functioning normally. section 6.3
  • PC/EL favors consistency during partitions but low latency in normal operation. section 6.3

Why response time changes the choice

Suppose a request eventually receives a non-error response, but only after thirty minutes. It can meet CAP's definition of availability while being unusable to a person waiting for it. PACELC makes response time explicit; a practical latency target might be 500 ms. section 6.10.1 section 6.3

Ask both questions when evaluating a database: what does it prioritize when nodes cannot communicate, and what does it prioritize when they can? The second answer matters even if partitions are rare. section 6.3

How The Coder Cafe covers it

How deep it goes
Defines both decisions and four combinations, but does not detail the mechanisms that implement them.
Examples
Contrasts DynamoDB's PA/EL classification with CockroachDB's PC/EC classification and uses a thirty-minute response to expose CAP's latency blind spot.
What it assumes
Builds on CAP's partition trade-off while explicitly defining the additional latency choice.
What you can do after
Evaluate/understand distributed database claims by checking both partition-time and normal-operation trade-offs.
How it connects
Connects CAP, network partitions, availability, consistency, and latency.

Also explained in

Compare how 3 books explain PACELC theorem →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Coder Cafe. The section links point to the parts of the book it draws on.