
Replication Lag
Why users see their old data after saving, and how to fix it
What you'll learn
- How a primary and read replicas work
- Why asynchronous replication causes stale reads
- What read-your-writes means, and how to guarantee it
- Monitoring replication lag
In this video, we'll look at why a user can save their new name and still see the old one on the next page. We'll cover how a primary database and read replicas work, why asynchronous replication makes replicas fall behind, and the read-your-writes guarantee users expect.
We'll also look at ways to fix stale reads: reading from the primary right after a write, tracking the write's position in the database log, and using synchronous replication.
By the end, you'll understand how replication lag affects your app, how to watch it in PostgreSQL and MySQL, and how to make sure users see their changes right after saving.



