Scalability and Performance · Remembering answers
Write-through, write-around and write-behind
Every cache needs a rule for writes. Update cache and database together, skip the cache, or update the database later. Each rule trades write speed, read freshness and the risk of losing data.
- Time20 min
- LevelDeveloper
- Experiments1 live
- Check6 questions







App server writes $18 to the cache and marks product 42 dirty.
Reply tells the admin "saved" after about 1 ms.
Flusher collects every dirty key into one batch.
Database commits the whole batch in one transaction.
Cache memory the dirty entry; gone if the process dies.
Cache replica a copy on a second node, if you configured one.
Cache's own log on disk for example a Redis append-only file, if enabled.