Part 3 of 5 · 1 min read
Monotonic reads
Without this guarantee, a user could see a value, then an older value, on two successive reads.
Think of checking a shared leaderboard twice in a row. First, a friend is ranked first; moments later, that same friend is ranked lower. Nothing actually changed; the second check simply looked at an older, less-caught-up copy of the board.
In plain words: monotonic reads guarantees that if a user has already seen a particular value for some piece of data, they will never later see an older value for that same data, even across separate reads that might be served by different followers with different amounts of lag. Without this guarantee, a user's two consecutive reads could hit two different followers, one more caught up than the other, making it look like data went backward in time, purely due to replication lag rather than anything that actually happened.
A worked example. A user refreshes a vote count twice in quick succession; without monotonic reads, the second read could be served by a more-lagging follower than the first, showing a lower vote count than the one already displayed moments earlier.
The key lines. No new SQL; monotonic reads is typically achieved by consistently routing a given user's reads to the same follower, rather than a different, potentially less-caught-up follower on every request.
Monotonic reads
Monotonic reads guarantees a user never sees an older value after already having seen a newer one for the same data, even across separate reads potentially served by differently-lagging followers.
Example: a leaderboard appearing to move backward between two quick checks, purely because the second check hit a less-caught-up copy, is exactly the glitch monotonic reads prevents.