CAP Theorem & PACELC

Why distributed data stores must trade off Consistency vs Availability during network partitions

Difficulty: Intermediate · Read time: 8 min · Access: Step-1 Preview + Knoera Pro

How It Works

The CAP Theorem—Consistency (C), Availability (A), and Partition Tolerance (P)—proves that whenever a Network Partition (P) splits a distributed database, it must choose between strict Consistency (every read sees the latest write or receives an error) and Availability (every reachable node answers without error, even if stale). The PACELC Theorem extends CAP to normal healthy operation: if there is a Partition (P), trade off Availability (A) vs. Consistency (C); Else (E, normal operation), trade off Latency (L) vs. Consistency (C).

Why It Matters

Network cables, switches, and cloud Availability Zone (AZ) links drop packets in production, making Partition Tolerance (P) mandatory. Whether you pick CP or AP—and whether you pay synchronous replication Latency (L) during healthy periods—decides whether your system prevents double-spending in a banking ledger or keeps an e-commerce shopping cart writable during an outage.

Interactive Architecture Scenarios

  • CP Mode (Consistency Over Availability)
  • AP Mode (Availability Over Consistency)

Related Lessons in Core Concepts & Scalability