PACELC Theorem - An Extension to CAP Theorem in Distributed Systems
The PACELC Theorem: Why CAP Isn't Enough for Modern Distributed Systems
Introduction: The Evolution Beyond CAP
For over two decades, the CAP theorem has been the cornerstone of distributed systems thinking. It states that in case of network partitioning ℗ in a distributed computer system, one has to choose between availability (A) and consistency ©. But as distributed systems evolved and became more sophisticated, engineers started noticing something crucial: CAP only tells half the story.
The PACELC theorem was first described by Daniel Abadi from Yale University in 2010 in a blog post, which he later clarified in a paper in 2012. The purpose of PACELC is to address his thesis that "Ignoring the consistency/latency trade-off of replicated systems is a major oversight [in CAP], as it is present at all times during system operation, whereas CAP is only relevant in the arguably rare case of network partitions.
What is PACELC?
PACELC (pronounced "pass-elk") stands for:
- Partition tolerance
- Availability
- Consistency
- Else (when no partitions exist)
- Latency
- Consistency
The theorem states that in case of network partitioning (P)
in a distributed computer system, one has to choose between availability (A)
and consistency (C)
(as per the CAP theorem), but else (E)
, even when the system is running normally in the absence of partitions, one has to choose between latency (L)
and loss of consistency (C)
.
Fig. 1: The tradeoff between availability, consistency and latency, as described by the PACELC design principle.
The Critical Gap CAP Left Behind
Why CAP Falls Short
CAP theorem has several limitations that PACELC addresses:
Binary Thinking: According to the CAP theorem, a database can be considered Available if a query returns a response after 30 days. Obviously, such latency would be unacceptable for any real-world application.
Partition-Only Focus: CAP assumes systems are always dealing with partitions, but the CAP theorem forces us to assume that the system has network partitions, which is not necessarily the case at all times.
Performance Blindness: PACELC was developed to address a key limitation of the CAP theorem: it makes no provision for performance or latency.
The ELC Extension: What Happens During Normal Operation?
What choices does a distributed system have when there are NO network partitions? The CAP theorem doesn't answer the question. The PACELC theorem answers this.
When your system is running normally (no partitions), you still face a fundamental tradeoff between:
- Latency
(L)
: How fast can you respond to requests? - Consistency
(C)
: How up-to-date is your data across all nodes?
The Four PACELC Configurations
There are four configurations or tradeoffs in the PACELC space:
- PA/EL - prioritize availability and latency over consistency.
- PA/EC - when there is a partition, choose availability; else, choose consistency
- PC/EC - prioritizes consistency over other considerations, both during network partitions and in normal operation.
- PC/EL - when there is a partition, choose consistency; else, choose latency
1. PA/EL Systems (High Availability + Low Latency)
- Examples: Cassandra, DynamoDB, ScyllaDB
- Philosophy: Always available, always fast, eventually consistent
- Use Cases: Social media feeds, content delivery, gaming leaderboards
ScyllaDB can be defined as PA/EL: partition tolerant, highly available, and oriented towards low latency as opposed to consistency.
2. PC/EC Systems (Strong Consistency Always)
- Examples: Google Spanner, traditional ACID databases
- Philosophy: Correctness over everything
- Use Cases: Financial systems, inventory management, banking
3. PA/EC Systems (Conditional Consistency)
- Examples: Some in-memory data grids
- Philosophy: Available during partitions, but consistent when possible
- Use Cases: Caching layers, session stores
4. PC/EL Systems (Partition-Sensitive)
- Examples: PNUTS (Yahoo's database)
- Philosophy: Becomes more consistent during partitions
- Use Cases: Systems with complex consistency requirements
Real-World Applications
Netflix: The EL Champion
Netflix exemplifies the EL aspect of the PACELC theorem by emphasizing low latency in normal operations. By optimizing for fast content delivery while accepting eventual consistency for some non-critical data, Netflix ensures a smooth and responsive user experience, even during high demand.
When you click play on a Netflix show, you get instant streaming (low latency) even if your watchlist updates take a moment to sync across all devices (eventual consistency).
Banking Systems: PC/EC in Action
Traditional banking systems prioritize consistency above all else. In a banking application, if one user transfers money, all other users should immediately see the updated balance to avoid discrepancies. They'll sacrifice both availability and latency to ensure your account balance is always accurate.
E-commerce During Sales: PA/EL Trade-offs
Consider an e-commerce application during a sale. If a data center goes offline due to a network issue, customers can still place orders through other available nodes. Although they may not see the most up-to-date inventory (due to potential stale reads), they can still interact with the system without downtime.
Implementation Considerations
Understanding Latency in Practice
From a general point of view, latency is a time delay between the cause and the effect of some physical change in the system being observed. In distributed systems, this translates to the time between sending a request and receiving a response.
Consider a write operation in a replicated database:
Write Request → Primary Node → Replicate to Secondary Nodes → Acknowledge Success
| | | |
0ms 5ms 15ms 20ms
- Strong Consistency: Wait for all replicas (20ms latency)
- Eventual Consistency: Acknowledge immediately (5ms latency)
Consistency Models Spectrum
PACELC recognizes that consistency isn't binary. You can choose from:
- Strong Consistency: All nodes see the same data simultaneously
- Eventual Consistency: Nodes will converge to the same state eventually
- Causal Consistency: Cause-and-effect relationships are preserved
- Session Consistency: Consistency within a user session
Making PACELC Decisions
Framework for System Design
Choose Wisely Between Consistency and Availability: Depending on your application requirements, you may prioritize availability (like in Cassandra) or consistency (like in Google Spanner). Assess your use case carefully.
Questions to Ask:
- What's the cost of stale data? (Financial systems: very high; Social feeds: low)
- What's the cost of downtime? (Emergency services: very high; Analytics dashboards: medium)
- What latency do users expect? (Gaming: <50ms; Batch reports: minutes are fine)
- How often do partitions actually occur? (Cross-datacenter: frequent; Single datacenter: rare)
Monitoring and Adaptation
The dynamics of distributed systems can change over time. Regularly monitor your system's performance and be ready to adjust your consistency and availability strategies based on real-world usage patterns.
Beyond the Theorems: Practical Wisdom
The Reality Check
Both CAP and PACELC are valuable tools, but neither is a step-by-step recipe for building systems. Instead, they provide mental models for evaluating tradeoffs and understanding the limits of distributed architectures.
Hybrid Approaches
Modern systems often implement different PACELC profiles for different data types:
- User profiles: PC/EC (strong consistency)
- Activity feeds: PA/EL (high availability, low latency)
- Analytics data: PA/EC (available but eventually consistent)
Conclusion: Thinking Beyond CAP
PACELC mostly takes aim at the first and fourth misconceptions I listed: that CA systems exist, and that eventual consistency is all about CAP. First, it doesn't allow you to ignore partition tolerance. Second, it makes it clear that even in the absence of partitions there's a tradeoff between consistency and latency.
The PACELC theorem doesn't replace CAP, it extends it. By acknowledging that systems must make consistency-latency tradeoffs even during normal operation, PACELC provides a more complete framework for understanding distributed systems behavior.
As we build increasingly complex distributed applications, from microservices to edge computing to IoT systems, having this nuanced understanding of tradeoffs becomes essential. The question isn't just "What happens when things break?" but "What happens when everything works perfectly?"
That's the insight PACELC brings: even in perfect conditions, distributed systems are about tradeoffs. The key is making conscious, informed decisions about which tradeoffs serve your users best.
Understanding PACELC helps developers make better decisions about database selection, consistency models, and performance optimization. It's not about finding the "right" answer it's about understanding the question more completely.
References
- PACELC design principle - Wikipedia
- PACELC Theorem Explained - Lohith Chittineni
- PACELC Theorem - Scylla DB
- CAP and PACELC Theorem in Plain English
- CAP Twelve Years Later: How the "Rules" Have Changed
- Please stop calling databases CP or AP - Martin Kleppmann
- A Critique of CAP Theorem
- Notes on Distributed Systems for Young Bloods
- Exploring the World of Distributed Systems: PACELC Theorem or Why CAP Is Not Enough
- PACELC Theorem How.dev
- CAP vs PACELC - Design Gurus
- CAP and PACELC: Thinking more Clearly about Consistency