Advanced
12 min forge

PACELC Theorem

An extension of CAP theorem that addresses the trade-offs between Latency and Consistency during normal operations.

πŸ“ PACELC Theorem

While the CAP theorem describes how a system behaves during a network partition (P), the PACELC theorem extends this to describe what happens during normal operation (Else).

1. What does PACELC stand for?

The acronym is broken down as follows:

  • P: If there is a Partition...
  • A: ...does the system choose Availability...
  • C: ...or Consistency?
  • E: Else (when there is no partition)...
  • L: ...does the system choose Latency...
  • C: ...or Consistency?

2. The Relationship with CAP

CAP theorem only covers the PAC part: "In the presence of a Partition, choose Availability or Consistency." PACELC adds the ELC part: "When the system is running normally (Else), choose between Low Latency or High Consistency."

3. Real-World Examples

  • DynamoDB / Cassandra (PA/EL): During a partition, they choose Availability. During normal operation, they prioritize low Latency (using eventual consistency).
  • Relational Databases with Synchronous Replication (PC/EC): They prioritize Consistency both during a partition (by refusing writes) and during normal operation (by waiting for all replicas to acknowledge).
  • VoltDB / MongoDB (PC/EL): They prioritize Consistency during a partition, but may choose Latency during normal operations.

4. Why it matters

Architects must realize that even when the network is healthy, there is a cost to consistency. To ensure all nodes are perfectly synced, the system must wait for network round-trips, which increases latency. If you want sub-millisecond responses, you often have to sacrifice "strong" consistency.