PACELC Theorem
CAP extended: what happens when there's NO partition?
1Beyond CAP
PACELC: If there is a Partition, choose Availability or Consistency. Else (no partition), choose Latency or Consistency.
2The Complete Picture
| System | If Partition (P) | Else (E) | PACELC |
|---|---|---|---|
| DynamoDB | Available | Low Latency | PA/EL |
| Cassandra | Available | Low Latency | PA/EL |
| MongoDB | Consistent | Consistent | PC/EC |
| PNUTS (Yahoo) | Consistent | Low Latency | PC/EL |
3Real-World Dry Run
Scenario: Global User Profile Service
EC (Consistent)
EU read waits for US sync (100-200ms latency). User sees updated profile.
Trade-off: Higher latency, perfect consistency
EL (Low Latency)
EU read returns immediately with cached data (5ms). User sees old profile for a few seconds.
Trade-off: Low latency, eventual consistency
4System Classifications
PA/EL
Prioritize availability and low latency. Sacrifice consistency.
Examples: DynamoDB, Cassandra, Riak
Use case: Social feeds, shopping carts, session stores
PC/EC
Prioritize consistency always. Sacrifice availability and latency.
Examples: MongoDB (strong), VoltDB
Use case: Banking, inventory, bookings
PA/EC
Available during partition, consistent otherwise. Rare.
Examples: Configurable systems
Use case: Mixed workloads
PC/EL
Consistent during partition, low latency otherwise.
Examples: PNUTS
Use case: User profiles, preferences
5Key Takeaways
?Quiz
1. No partition. You want sub-10ms reads globally. PACELC choice?
2. DynamoDB's PACELC classification is: