Explain CAP vs PACELC.
CAP vs PACELC: CAP says that during a network partition you must sacrifice either consistency or availability; PACELC says that even without partitions, systems must trade between latency and consistency.
When to Use
Use CAP to reason about failure scenarios where the network splits; use PACELC to guide design decisions under normal operations where you balance latency against consistency.
Example
If a network partition occurs, you must either reject writes (consistency) or allow stale reads (availability).
Without a partition, PACELC highlights the choice: sync all replicas (slower, consistent) or respond quickly from one (faster, less consistent).
Want to dive deeper?
Check out Grokking System Design Fundamentals, Grokking the System Design Interview, or practice with Mock Interviews with ex-FAANG engineers.
Why Is It Important
These models frame the core trade-offs every distributed database or system must face, shaping decisions for cloud storage, microservices, and large-scale apps.
Interview Tips
Be ready to define both laws clearly: CAP (consistency vs availability during partition) and PACELC (latency vs consistency when no partition). Mention real systems—Cassandra favors availability, BigTable favors consistency.
Trade-offs
CAP trade-off: availability vs consistency in failures. PACELC trade-off: latency vs consistency in normal operation. Both influence scalability and user experience.
Pitfalls
- Thinking CAP is “choose any two”—partition tolerance is unavoidable.
- Forgetting PACELC—latency and consistency matter even without failures.
GET YOUR FREE
Coding Questions Catalog
$197

$78
$78