Your cache is serving the answer you already changed: mini course video thumbnail

Free mini course

Your cache is serving the answer you already changed

The write path updates the row in Postgres and stops there. The read path checks Redis first and never learns anything changed. So a user edits their own profile, gets a 200 back, reloads the page, and sees the old name staring at them.

This Short draws the drift moving: the update lands in the database, the next read hits the cache, the stale value comes back, and nothing errors and nothing pages. Then the fix: delete the key inside the same write, or write through, because a TTL is not invali

Watch on YouTube

The write path updates the row in Postgres and stops there. The read path checks Redis first and never learns anything changed. So a user edits their own profile, gets a 200 back, reloads the page, and sees the old name staring at them.

This Short draws the drift moving: the update lands in the database, the next read hits the cache, the stale value comes back, and nothing errors and nothing pages. Then the fix: delete the key inside the same write, or write through, because a TTL is not invali

Frequently asked questions

What is Your cache is serving the answer you already changed about?

The write path updates the row in Postgres and stops there. The read path checks Redis first and never learns anything changed.

Which topics does this mini course relate to?

System Design, Caching, Tech Interview Preparation, Databases, Redis, Python.