Question #16 of 60•Databases•Medium• ~3 min read

When do you choose Eventual Consistency vs. Strong Consistency (PACELC Theorem)?

Executive Takeaway

Understand consistency limits in partitioned networks and the tradeoffs between latency and accuracy under normal operations.

Architectural Breakdown & AnalysisFAANG Aligned

The CAP Theorem proves that during a network partition (P), a distributed system must choose between Availability (A) and Consistency (C).

The PACELC Theorem Extension

PACELC extends CAP by incorporating normal operating conditions when no network partition exists:

  • If Partition (P): Choose between Availability (A) vs. Consistency (C).
  • Else (E): Choose between Latency (L) vs. Consistency (C).

System Classifications

  • PA/EL (DynamoDB, Cassandra): Prioritizes Availability during partitions and low Latency during normal operations. Reads may return stale data briefly.
  • PC/EC (Spanner, Relational DBs): Prioritizes Consistency at all times. Will reject writes/reads or wait for global consensus before returning.
NOTE — Financial vs Social Systems

Financial balances require PC/EC (Strong Consistency). Social media likes and view counters leverage PA/EL (Eventual Consistency).

Key Architectural Comparison

PACELC ModelIf Partitioned ($P$) Choose:Else ($E$) Choose:Concrete Database Example
PC / ECConsistency ($C$) over Availability.Consistency ($C$) over Latency.Google Cloud Spanner, CockroachDB
PC / ELConsistency ($C$) over Availability.Latency ($L$) over Consistency.PostgreSQL / MySQL with Async Read Replicas
PA / ELAvailability ($A$) over Consistency.Latency ($L$) over Consistency.Apache Cassandra, Amazon DynamoDB, Couchbase
PA / ECAvailability ($A$) over Consistency.Consistency ($C$) over Latency.VoltDB, BigTable (Tunable configurations)
Previous QuestionHow do you handle hot partitions (the celebrity problem) in social feeds?Next Question How does an LSM-Tree storage engine differ from a B-Tree?

Continue Learning on Being SDE

Explore deep-dive system architecture modules, low-level object-oriented designs, and interview cheat sheets.