What is the difference between strong and eventual consistency?
Strong consistency means every read sees the latest completed write. Eventual consistency means replicas may briefly return old data but will all converge to the same value if no new writes arrive.
Explain it simply
You change your profile photo. With strong consistency, anyone who loads your profile after the change sees the new photo, no exceptions. With eventual consistency, a friend on another server may still see the old photo for a few seconds, then it catches up.
Why would anyone accept stale data? Because keeping every copy in sync before answering takes coordination between machines, which costs latency and can block during network trouble. Eventual consistency answers from the nearest copy and syncs in the background, so it is faster and stays available.
Choose by the cost of being wrong. A bank balance or seat booking needs strong consistency. A like counter, a view count or a feed can be a little stale.
Example
Two replicas, A and B, of a like counter at 100.
t0: user likes -> write goes to A A=101, B=100
t1: friend reads from B sees 100 (stale)
t2: replication reaches B A=101, B=101
t3: friend reads from B sees 101 (converged)Between t0 and t2 the system was only eventually consistent.
What to say in the interview
"Strong consistency guarantees reads return the latest write, at the cost of coordination and latency. Eventual consistency lets replicas lag but guarantees convergence, which gives speed and availability. I pick strong for money and inventory, eventual for feeds, counters and recommendations."
Common mistakes
- Saying eventual means data may be lost; it means temporarily stale, not lost.