vishal patel
UnderstoodIntermediateUpdated 2026-09-23

CAP & PACELC Theorems

During a network partition you choose consistency or availability; when there's no partition you still trade latency against consistency.

consistencyavailabilitypartitionstheory

CAP, stated correctly

In a distributed data store, when a network Partition happens, you must choose between:

  • Consistency: every read sees the latest write, or you get an error.
  • Availability: every request gets a non-error response, possibly stale.

Partitions are not optional in real networks. So it's not "pick 2 of 3". It's "when a partition happens, pick C or A."

PACELC — the everyday trade-off

diagram
System (typical config)PACELCNotes
DynamoDB, CassandraPA/ELTunable; defaults favour availability and latency
MongoDB (majority writes and reads)PC/ECTunable via write/read concern
Spanner, CockroachDBPC/ECConsistency first, with engineering to minimise latency
Redis (async replicas)PA/ELFailover can lose acknowledged writes

How to use this in design

Decide per operation, not per system:

  • Inventory decrement, payments, permission changes: CP.
  • Product views, feeds, analytics counters: AP is fine.
  • Content preview can be strongly consistent while CDN delivery is eventually consistent. Same product, different choices.

Cheatsheet

The whole topic on one page. Click to open full screen.

Sources & further learning

Videos, courses, docs and books I recommend for this topic.

Related topics