Consistency models ਨਿਸ਼ਚਿਤ ਕਰਦੇ ਹਨ ਕਿ ਡੇਟਾ ਅਪਡੇਟਸ ਕਦੋਂ ਅਤੇ ਕਿਵੇਂ ਇੱਕ distributed system ਵਿੱਚ ਦਿਖਾਈ ਦਿੰਦੇ ਹਨ — strong consistency (ਹਰ ਕੋਈ ਤੁਰੰਤ ਸਭ ਤੋਂ ਨਵੀਨ ਡੇਟਾ ਦੇਖਦਾ ਹੈ) ਤੋਂ ਲੈ ਕੇ eventual consistency (ਅਪਡੇਟਸ ਸਮੇਂ ਦੇ ਨਾਲ ਫੈਲਦੇ ਹਨ) ਤੱਕ। ਇਹ ਚੋਣ availability ਅਤੇ performance ਦੇ ਨਾਲ ਟ੍ਰੇਡ-ਆਫਸ ਨੂੰ ਸ਼ਾਮਲ ਕਰਦੀ ਹੈ।
Strong ਬਨਾਮ 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)
