一致性模型定义了数据更新在分布式系统中何时以及如何变得可见的保证 — 从强一致性(所有人立即看到最新数据)到最终一致性(更新随时间传播)。这种选择涉及与可用性和性能的权衡。
强一致性 vs 最终一致性
STRONG CONSISTENCY → every read returns the MOST RECENT write (all nodes agree immediately):
✓ simple to reason about; always correct/current data
✗ requires coordination → higher latency, lower availability (especially during partitions)
→ for: data that must be correct/current (financial balances, inventory, bookings)
EVENTUAL CONSISTENCY → updates propagate over time; reads MAY return stale data briefly,
but all nodes CONVERGE eventually:
✓ high availability, low latency, scalable
✗ reads can be stale temporarily (must tolerate this)
→ for: data where brief staleness is OK (social feeds, likes, view counts, caches)
