Consistency models: linearizable to eventual
A consistency model is the promise a replicated store makes about what a read can return. "Strong" and "eventual" are the two ends; in between sit guarantees with names an interviewer may use: causal, read-your-writes, monotonic reads. The skill is matching each piece of data to the weakest promise that's still safe, because stronger promises cost latency and availability.
Watching the match
You're watching a final. In the stadium there's one scoreboard: the moment it changes, everyone who looks at it afterwards sees the new score. At home, you're watching a stream that runs 20 seconds behind, and your neighbour's TV is 5 seconds behind. You hear him cheer before your screen shows the goal. Your stream will show it, just later. But it will never show the celebration before the goal, and it never jumps back to an older score once it has shown a newer one.
- the streams and your neighbour's TV → followers, each some seconds behind, and you → a reader
- the one scoreboard → linearizable: behaves as one copy, in real time
- every stream shows the goal sooner or later → eventual
- the celebration never before the goal → causal
- never back to an older score → monotonic reads