Cache

Write-through

You write to the cache, and the cache writes to the database right away. Writing is slower, but the cache never goes stale.

Example

You change your email: it's saved to the cache and the database at the same moment. It takes a bit longer, but anyone who reads it sees the new one.

Test yourself: Write-through

Cache

With write-through, data is written to the cache and the database at the same time.

Lessons that use it

More cache terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.