Skip to Content

PACELC theorem

Intro

  • Check CAP theorem notes
  • 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 a network partition
  • A high availability requirement implies that the system must replicate data. As soon as a distributed system replicates data, a trade-off between consistency and latency arises.
Consistency ^ PA/EC | PC/EC | Availability <--AP---------+---------CP--> Consistency | PA/EL | PC/EL v Latency
  • 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 consistency (C).
If there is a Partition How does the system trade-off Availability & Consistency? Else How does the system trade-off Latency & Consistency?
  • So for example PA/EC means Under Partition, favor Availability, Else favor Consistency

Examples from wiki

  • The default versions of DynamoDB, Cassandra, Riak and Cosmos DB are PA/EL systems: if a partition occurs, they give up consistency for availability, and under normal operation they give up consistency for lower latency.
  • Fully ACID systems such as VoltDB/H-Store, Megastore, MySQL Cluster and PostgreSQL are PC/EC: they refuse to give up consistency, and will pay the availability and latency costs to achieve it. BigTable and related systems such as HBase are also PC/EC.
  • MongoDB can be classified as a PA/EC system. In the baseline case, the system guarantees reads and writes to be consistent.
  • PNUTS is a PC/EL system.

real world trade-offs: Availability vs. Consistency v.s. Latency

  • It’s a business (not engineering) decision
    • “Would you rather be down or potentially show wrong result?”
    • “Would you rather be slow or potentially show wrong result?”
Last updated on