Skip to main content

Consistency Patterns

TL;DR

Strong: All nodes see same data immediately. Eventual: Nodes converge over time. Causal: Related events seen in order. Trade-off: Consistency vs availability (CAP theorem).

Consistency Models

ModelGuaranteeLatencyUse Case
StrongAlways latest valueHighBanking, inventory
EventualConverges eventuallyLowSocial media, DNS
CausalCause before effectMediumChat (reply after message)
SessionYour writes visible to youLowShopping cart

Strong Consistency

Cost: High latency (wait for sync replication)

Eventual Consistency

Benefit: Low latency (don't wait for replication)

Quick Reference

  • CAP theorem: CP (strong) or AP (eventual)
  • Strong: Banking, inventory, voting
  • Eventual: Social media, analytics, DNS