Course contentsShow
← System Design
Lesson 509 of 1,91914. CAP TheoremFree lesson

Latency: The Hidden Cost of CAP

Achieving strong consistency during normal operation often increases latency; CAP doesn't capture performance trade-offs explicitly.

Latency: The Hidden Cost of CAP

What you'll learn: How prioritizing strong consistency affects system latency, a performance dimension CAP theorem doesn't explicitly address.

The Hidden Trade-off

CAP theorem tells us we must choose between consistency and availability during a network partition — but it says nothing about latency. In reality, even during normal operation (no partition), achieving strong consistency often comes at a significant latency cost that CAP doesn't capture.

Why Consistency Increases Latency

When a system enforces strong consistency:

  • Coordination overhead: Multiple nodes must communicate and agree before responding
  • Synchronous replication: Writes wait for acknowledgment from all replicas
  • Lock contention: Distributed locks serialize operations across the system
  • Quorum waits: Systems must contact and wait for multiple nodes before returning results

Analogy: Imagine a committee that must get unanimous approval (strong consistency) versus one where the first person to respond decides (weak consistency). The unanimous approach guarantees everyone agrees, but takes much longer.

What CAP Misses

CAP theorem focuses on the binary choice during partitions: can you respond at all (availability) and with what guarantees (consistency)? It doesn't measure:

  • How fast you respond during normal operation
  • The performance degradation from coordination protocols
  • The user experience impact of added latency

A CP system might technically be "available" (responds eventually) but so slow that users perceive it as unavailable.

The Real-World Impact

Financial systems (CP) accept higher latency for correctness. Social media feeds (AP) sacrifice consistency for snappy response times. The latency cost is often the deciding factor in practice, not just the partition behavior.

Key Takeaway: Strong consistency requires coordination that adds latency even when the network is healthy — CAP doesn't account for this performance dimension, making latency a critical but hidden trade-off in system design.