The problem in one picture
A user edits their bio and taps Save. The page reloads and shows the old bio. They tap Save again. Now support gets a ticket saying "profile edits are broken".
Nothing is broken. The write went to the leader database. The reload read from a follower that hadn't received the write yet. That gap is replication lag, and every system that reads from replicas has it.
Why you can't make lag zero
Followers exist so reads scale and survive a leader failure. If every write had to wait until every follower confirmed, a slow follower in another region would slow every save. So most systems replicate asynchronously and accept that followers trail by milliseconds normally and by seconds or minutes on a bad day.
Since the lag won't go away, the real question is which reads are allowed to see stale data. Two guarantees cover most of what users notice.
Guarantee 1: read your own writes
After I change something, I should see my change. Other people can see it a moment later and nobody will notice. Common ways to provide it:
Read from the leader for a short time after a write. Track the user's last write time and send their reads to the leader for, say, the next minute.
Read your own data from the leader. A user's own profile always reads from the leader; everyone else's profile can come from followers.
Carry a version token. The write returns a position in the replication log. The client sends it on the next read, and a follower only answers if it has caught up to that position; otherwise the read goes to the leader.
The version token is the most precise of the three. It costs nothing when followers are caught up and only falls back when they aren't.
Guarantee 2: monotonic reads
A user refreshes a comment thread and sees 12 comments, refreshes again and sees 10, then 12 again. Each read went to a different follower with a different lag. Time seems to go backwards.
The fix is to pin each user to one follower, for example by hashing the user ID. They may see slightly old data, but never older than what they saw last time.
What Facebook actually does
Facebook's TAO, described at USENIX ATC 2013, serves the social graph from caches spread across regions. Under normal operation it is eventually consistent, and the paper says replication lag "is usually less than one second".
That's too much for the person who just made a change, so TAO handles them specially:
Writes go from a follower cache to its leader cache, which forwards them to the leader in the region that holds the master database.
When the reply comes back, "the follower that issued the write is updated synchronously". Other followers catch up asynchronously.
The result is read-after-write consistency within a single tier, which is exactly the "read your own writes" guarantee for the user on that tier.
For the few reads that can never be stale, such as authentication checks, a read can be marked critical and is sent to the master region.

The lesson is the shape, not the specifics: make the common path eventually consistent, give the writer their own change immediately, and keep a strong-read escape hatch for the handful of cases that need it.
How to choose in an interview
When you add read replicas, say out loud:
Which reads can be stale (feeds, counts, other users' profiles) and which can't (my own edits, balances, permissions).
How the writer sees their own change: leader reads after a write, or a version token.
Whether users can see time go backwards, and if so, pin them to a replica.
What happens when lag spikes: you watch replica lag and stop sending reads to followers that fall too far behind.
Success criteria: check yourself
Pick an approach for each:
A user changes their display name and is redirected to their profile.
A bank app shows the account balance right after a transfer.
A product page shows the review count.
You've got it if you chose: (1) read-your-writes, through leader reads after a write or a version token; (2) a strong read from the leader, because a stale balance after a transfer looks like lost money; (3) any follower, because a review count that's a second old harms no one.
Interview angle
"Add read replicas" is an L4 answer. Naming replication lag and giving read-your-writes for the writer is L5. Splitting reads by how stale they're allowed to be, with a critical-read escape hatch and replica-lag monitoring that removes lagging followers, is L6.
Next up
Next Thursday: Quorums, the N, R, W formula, and why Amazon's DynamoDB kept the Dynamo name but dropped most of the original design.


The version token is the one I push for too, with one catch: it has to survive the redirect. If the save response returns it but the profile page comes from a service that never receives it, the user still sees the old bio.