Notesdistributed🌱 seedling

PACELC

Also: PACELC Theorem · PACELC Design Principle

If there's a Partition, choose Availability or Consistency; Else, choose Latency or Consistency. It adds the trade-off CAP ignores, the one you pay on every request when nothing is broken.

Why it exists

Partitions are rare, yet systems relax consistency all the time. The reason is latency: keeping replicas consistent means waiting for remote acknowledgements on every operation, partition or not.

How it works

  • PA or PC: the CAP choice during a partition.
  • EL or EC: in normal operation, reply after local work (low latency, replicas briefly stale) or wait for remote replicas (consistent, slower).
  • The else-branch cost is a round trip to the slowest replica you wait for; across regions that dominates request latency.
  • Classifications as systems shipped in 2012: Dynamo, Cassandra, Riak PA/EL; VoltDB/H-Store and Megastore PC/EC; PNUTS PC/EL.

Trade-offs

EL EC
fast, local replies every write waits on remote replicas
stale reads elsewhere for a while reads anywhere see the write
asynchronous replication risks synchronous replication latency

In practice

  • Many modern stores are tunable per request (Cassandra consistency levels, DynamoDB read modes), so the labels describe defaults, not identities.
  • Cross-region strong consistency (Spanner) accepts EC latency, softened by TrueTime and local reads at a timestamp.

Pitfalls

  • Assuming a "CP" system is fast when healthy. EC means every request pays coordination latency.
  • Treating a label as fixed: configuration and per-query settings move a system across the grid.

Recall

These cards are also in your review deck, scheduled with spaced repetition.