[Avg. reading time: 6 minutes]
PACELC
The PACELC theorem is indeed a direct extension of the CAP theorem.
If Partition exists choose between Availability or Consistency Else Latency or Consistency
What If Partition Exists (P) means
- A network partition has occurred
- Some nodes cannot communicate with others
- Messages are dropped, not just delayed
When CAP exists why PACELC?
CAP focuses exclusively on what happens during a network failure (a “partition”), PACELC addresses a major critique: it accounts for how a system behaves during normal, healthy operation.
- Most systems run without network partitions most of the time
- Datacenters are engineered to avoid partitions
- Partitions are rare but catastrophic
- So when everything works, you still trade consistency vs latency.
Distributed System
|
v
Is there a network partition?
|
+-----------+-----------+
| |
YES (P) NO (ELSE)
| |
v v
Availability (A) Low Latency (L)
| |
- Keep serving - Read nearest replica
- May return - Async replication
inconsistent data - Possible staleness
|
|
v
Consistency (C) Consistency (C)
| |
- Block / error - Quorum / consensus
- Wait for quorum - Higher latency
- Data always correct - Strong guarantees
| Database | P: Availability vs Consistency | ELSE: Latency vs Consistency | PACELC Class | Notes |
|---|---|---|---|---|
| Cassandra | Availability | Latency | PA / EL | Always-on design, async replication, eventual consistency |
| DynamoDB | Availability | Latency | PA / EL | Dynamo-style, low latency reads, consistency is optional |
| Riak | Availability | Latency | PA / EL | Conflict resolution after the fact |
| CouchDB | Availability | Latency | PA / EL | Multi-master replication, conflicts expected |
| MongoDB (Replica Set) | Consistency | Consistency | PC / EC | Primary-based writes, blocks during elections |
| HBase | Consistency | Consistency | PC / EC | Strong consistency via HDFS, higher coordination cost |
| Google Spanner | Consistency | Consistency | PC / EC | Global consensus, correctness over latency |
| CockroachDB | Consistency | Consistency | PC / EC | Distributed SQL, serializable isolation |
| Elasticsearch | Availability | Latency | PA / EL | Search-first, stale reads acceptable |
| Redis Cluster | Availability | Latency | PA / EL | Speed first, eventual consistency under failure |