System Design
7. Caching ArchitectureAnimated
Cache Performance Optimisation
Raising hit rate and cutting latency.
The idea
Tune sizes, TTLs, key design and eviction, and measure hit rate and latency.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- hit
- current request
A is missing: fetch it from the database and store it.
- step:
- 1
- hits:
- 0
1/22
Eviction policy: least recently used.
Step by step
- 1Measure hit rate
- 2Find popular keys
- 3Tune TTL and size
- 4Re-measure
Where it is used
Cost and latency tuning.
Watch out for
A high hit rate on unimportant data is not a win.