CodePark/ questions / CAP, consistency & distributed data
START PRACTICINGPRACTICE
Backend question · System design & architecture › CAP, consistency & distributed data

What does PACELC add to CAP? Classify a typical Dynamo-style store and explain why the "else" part matters day to day.

PACELC adds the normal case, when nothing fails. It reads like this:

  • If there is a Partition, choose Availability or Consistency.
  • Else (in normal operation), choose Latency or Consistency.

So the trade-off exists even without failures. To keep replicas strongly consistent, a node must wait for other replicas on every write or read. These replicas are often in other zones or regions. This waiting costs latency (extra response time).

Dynamo-style stores are usually classed as PA/EL. Examples are Cassandra, and DynamoDB with default settings. During a partition, they stay available. In normal operation, they favour low latency over consistency. They offer tunable or optional strong reads, at extra cost.

Systems that replicate synchronously by consensus are closer to PC/EC. Consensus means the nodes vote and agree on each write before it counts.

Why does the "else" part matter day to day? Partitions are rare. But you pay the latency cost of strong consistency on every request. So most of the real design decision is about latency in the normal case.

  • During a partition, choose A or C. Else, choose L or C.
  • Strong consistency costs latency even when nothing fails.
  • Dynamo-style stores are PA/EL, with tunable consistency.
  • Stores that replicate by consensus lean towards PC/EC.
  • Latency in the normal case is the everyday trade-off.