System Design · Senior · Question 23 of 75
How do cache-aside, write-through and write-back strategies differ?
- ✓Correct answer: Cache on read; write to cache and DB; deferred write to DB
- 2They're three names for one strategy in different databases
- 3They differ only in the amount of memory allocated to the cache
Explanation
Cache-aside (lazy loading) is the most common: on a miss, read the DB and put the result in the cache. Write-through keeps the cache up to date at the cost of slower writes. Write-back is faster but risks losing data if the cache fails.