Original
Telegram: book_cube
Original post with analysis of the PACELC theorem.
The CAP theorem explains the behavior of a system during network failures. But what happens when everything works fine? The PACELC theorem extends CAP and describes the tradeoffs of distributed systems during normal operation.
Related chapter
CAP theorem
Fundamental limitation of distributed systems.
Statement of the theorem
if P then (A or C) else (L or C)
PACELC formula
If a network split occurs, the system chooses between:
In normal mode, the system chooses between:
Foundation
HTTP protocol
Protocol-level latency affects the L vs C tradeoff.
Why is PACELC needed?
The CAP theorem does not explain why systems like Amazon Dynamo or Cassandra choose eventual consistency. After all, network divisions are rare. Real reason:
Key insight
Eventual consistency is used not only in case of accidents, but also for reducing delays in daily work. This is the “L over C” choice in the “Else” part of the PACELC theorem.
System classification
PACELC gives four categories of systems depending on their choice in each situation:
Detailed analysis of categories
PA/EL - Speed comes first
Systems in this category sacrifice strict consistency for speed and reliability. In partition, availability is selected; in normal mode, minimum delays are selected.
PC/EC - Consistency at any cost
Always choose consistency. With partition they can refuse service; in normal mode they are ready to endure high delays for the sake of consistency.
PA/EC - Hybrid Approach
In case of failures, they maintain availability, but in normal mode they strive to ensure consistency. A trade-off between reliability and correctness.
PC/EL - Severity in case of failures, speed is normal
With partition, they choose consistency (they may fail), but in normal mode they work as quickly as possible, allowing for temporary inconsistency.
Story
Theorem proposed Daniel Abadie (Daniel Abadi) in the article "Consistency Tradeoffs in Modern Distributed Database System Design".
Trade-off visualization
Latency vs Consistency Trade-off
Interactive chart showing how distributed systems are positioned.
Systems in the lower-left prioritize response speed and allow temporary replica divergence.
Systems in the upper-right guarantee consistency, paying with higher latency due to synchronization.
Disclaimer: System positions on this chart are qualitative estimates, not exact measurements. Real characteristics depend on configuration, workload, version, and network conditions.
The PACELC classification is based on Daniel Abadi’s paper "Consistency Tradeoffs in Modern Distributed Database System Design" (2012) and widely accepted industry classification.
Classification sources
| Database | Category | Source |
|---|---|---|
Cassandra | PA/EL | Apache Docs |
DynamoDB | PA/EL | AWS Docs |
Riak | PA/EL | Riak Blog |
CouchDB | PA/EL | CouchDB Docs |
Redis Cluster | PA/EL | Redis Docs |
Voldemort | PA/EL | Voldemort Design |
ScyllaDB | PA/EL | ScyllaDB Docs |
MongoDB | PA/EC | MongoDB Docs |
Cosmos DB | PA/EC | Azure Docs |
Firebase RTDB | PA/EC | Firebase Docs |
PNUTS | PC/EL | VLDB Paper |
HBase | PC/EL | HBase Book |
FoundationDB | PC/EL | FDB Docs |
VoltDB | PC/EC | VoltDB Docs |
Spanner | PC/EC | Google Cloud |
CockroachDB | PC/EC | CRDB Docs |
YugabyteDB | PC/EC | YugabyteDB Docs |
TiDB | PC/EC | TiDB Docs |
PostgreSQL | PC/EC | PostgreSQL Docs |
MySQL Cluster | PC/EC | MySQL Docs |
Megastore | PC/EC | Google Research |
More details
Jepsen and consistency models
Complete hierarchy of consistency models from the Jepsen project.
Consistency Models: The Whole Picture
PACELC talks about choosing between Latency and Consistency, but what exactly is meant by "consistency"? Project Jepsen created a complete hierarchy of models showing how transactional isolation (RDBMS) and linearizability (distributed systems) converge at the top.
Jepsen and consistency models
Hierarchy of consistency models, Serializable vs Linearizable, testing distributed systems
Key Findings
- PACELC explains the choice of eventual consistency in systems like Dynamo - it's not just about accidents
- Latency vs Consistency - a key trade-off for highly loaded systems in normal mode
- Most NoSQL databases are PA/EL, most traditional DBMSs are PC/EC
- The choice of category depends on business requirements: finance requires PC/EC, social networks - PA/EL
