Limited Offer

30% OFF Lifetime Access ($139) with code SYSTEM30

TOPIC #77Intermediate 8 min read

The PACELC Theorem

💡
Core Architecture Summary

Extend CAP to normal operating conditions: If Partitioned (P) choose Availability (A) or Consistency (C); Else (E) choose Latency (L) or Consistency (C).

Key Glossary Concepts in this TopicAll Glossary Terms

PACELC Decision Tree 🌳

Explicitly handling both Partitioned and Normal operation trade-offs.

PACELC Decision Tree 🌳
100%
Rendering visual architecture flowchart...

01.1. Why Daniel Abadi Created PACELC

While the CAP Theorem provided a crucial foundational framework, system architects quickly identified a major practical limitation: CAP only describes database behavior during rare network partitions.

In production cloud environments, network partitions occur less than 0.1% of the time. In the remaining 99.9% of normal operations, the system is functioning without network partitions.

In 2012, Professor Daniel Abadi formulated the PACELC Theorem to address the critical trade-off that occurs during ordinary happy-path operation:

\textbf{If } Partitioned \implies choose Availability or Consistency;

\textbf{E}lse \implies choose Latency or Consistency.

Even when all networks and nodes are perfectly healthy, a database cannot simultaneously achieve sub-millisecond write latency and instant cross-region strong consistency, because transmitting data over physical distance takes time.

02.2. The Four PACELC Archetypes

PACELC categorizes all distributed storage engines into four primary design profiles:

  1. PC/EC (e.g., Google Spanner, CockroachDB, Bigtable, ZooKeeper):
    • If Partitioned: Favors Consistency (rejects writes on minority partitions).
    • Else (Normal): Favors Consistency (waits for synchronous Raft/Paxos quorum consensus across nodes before returning success to the client, accepting +20ms to +50ms latency overhead).
  2. PA/EL (e.g., Apache Cassandra, Amazon DynamoDB, Couchbase, Riak):
    • If Partitioned: Favors Availability (allows independent writes on all partitions).
    • Else (Normal): Favors Latency (writes locally to in-memory MemTable and commits immediately in < 2ms, replicating asynchronously in the background).
  3. PC/EL (e.g., PostgreSQL with Asynchronous Primary-Replica Replication):
    • If Partitioned: Favors Consistency (all writes must hit the primary).
    • Else (Normal): Favors Latency (read queries hit asynchronous replicas with < 1ms latency, tolerating minor replication lag).
  4. PA/EC (Rare Hybrid):
    • If Partitioned: Favors Availability (serves stale reads).
    • Else (Normal): Favors Consistency (enforces synchronous quorum verification during normal operation).

03.3. Architectural Summary Matrix

DatabasePACELC ProfileNormal Operation Write LatencyPartition Behavior
CockroachDBPC / EC15ms - 50ms (Synchronous Raft Consensus)Halts minority replicas; strict linearizability.
Google SpannerPC / EC10ms - 30ms (TrueTime + 2PC + Paxos)Rejects transactions in disconnected regions.
Apache CassandraPA / EL1ms - 5ms (Local Append-Only CommitLog)Accepts writes on any live node; eventual consistency.
DynamoDB (Default)PA / EL2ms - 8ms (Single-Digit Millisecond SSD)High availability; eventual consistency across AZs.
MongoDB (w:1)PA / EL< 2ms (Unacknowledged replica write)Read stale secondary; primary failover window.
MongoDB (w:majority)PC / EC10ms - 25ms (Majority ACK)Rejects writes if majority replica set unreachable.

⚖️Architectural Trade-offs & Production Realities

Architectural Advantages

  • Accurately reflects the day-to-day latency trade-offs inherent in synchronous vs asynchronous replication
  • Provides a granular framework for selecting databases based on both uptime SLAs and p99 latency budgets

Trade-offs & Constraints

  • More complex taxonomy (5 letters) than the traditional 3-letter CAP theorem
  • Many modern databases feature tunable consistency levels (e.g. Cassandra QUORUM vs ONE), making classification dynamic
Production Implementation in Big Tech
Cassandra / ScyllaDB• PA/EL High-Throughput Ingestion

Cassandra trades strong consistency for low write latency during normal operation by writing locally to CommitLog + MemTable and asynchronously replicating to peers.

🎯 Staff+ Engineering Takeaways

  • PACELC covers both abnormal (partition) and normal (happy path) database trade-offs.
  • In normal operations: High consistency requires network roundtrips, increasing write latency.
  • Low latency requires asynchronous background replication (eventual consistency).
  • PA/EL maximizes speed and availability; PC/EC maximizes data correctness.

Topic Knowledge Assessment 🧠

Step through 1 scenario question to test your staff-level grasp.

Question 1 of 10 answered
#1

In PACELC notation, what does PA/EL mean?

Rate This Architecture Chapter4.9 / 5.0 (38 ratings)

How clear and staff-actionable was this system breakdown?