Networking Lab · LAB-06Under investigation
“Adding a cache always makes it faster.”
A cache with a poor hit rate adds a lookup, a write, an eviction policy and an invalidation bug, in exchange for very little.
- Verdict
- IT DEPENDS
- Level
- SYSTEMS
- Division
- LAB-06
- References
- 02
Investigation
Cache benefit is roughly hit_rate × saved_cost − overhead. At a 10% hit rate on an operation that was already fast, the overhead dominates. Worse, a cache changes the failure mode: instead of being slow, the system is now occasionally wrong, and wrong is harder to notice.
| Failure | Symptom |
|---|---|
| Stale entry | Users see old data; the bug is invisible in staging |
| Cache stampede | The entry expires under load and every request rebuilds it at once |
| Key collision | One user sees another user's data, a cache bug that is a security incident |
| Unbounded growth | Memory rises until something is evicted or something dies |
| Cached error | A 500 is stored and served happily for an hour |