System Design
7. Caching ArchitectureAnimated
Write-Around Cache
Write to the database and skip the cache.
The idea
Writes go straight to the database. The cache fills only on reads.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Check the in-process cache: nanoseconds.
- step:
- 1/4
- at:
- Request
1/10
The green dot is a request moving through the system.
Step by step
- 1Write to the database
- 2Cache is untouched
- 3Next read misses
- 4The read populates the cache
Where it is used
Data that is written but rarely read.
Watch out for
The first read after a write is slow.