Consistency models అనేవి డిస్ట్రిబ్యూటెడ్ సిస్టమ్లో డేటా అప్డేట్లు ఎప్పుడు మరియు ఎలా కనిపించాలో గ్యారంటీలను నిర్వచిస్తాయి — strong consistency (ప్రతి ఒక్కరూ తక్షణమే సరికొత్త డేటాను చూస్తారు) నుండి eventual consistency (అప్డేట్లు సమయానికి ఆధారంగా ప్రచారం చేయబడతాయి) వరకు. ఆప選択 చేయడం అందుబాటు మరియు పనితీరుతో ట్రేడ్ఆఫ్లను కలిగి ఉంటుంది.
Strong vs eventual consistency
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)
