What is cache penetration, and how do null caching and Bloom filters solve it?
Short answer
Penetration: requests ask for keys that do not exist, the cache never hits, so every request reaches the DB. Fix it by caching the empty result or a Bloom filter.
3 points to say:
- Validate the input first.
- Cache empty results for 30–60 seconds.
- A Bloom filter is only certain when it says "no".
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.