Redis & Caching (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is a Bloom Filter in Redis (RedisBloom) and how does it eliminate Cache Penetration?
senior LevelMost AskedSystem Design
In Simple Words: A Bloom Filter is a space-efficient probabilistic data structure used to test set membership:
- Returns: "Definitely NOT in the set" or "Might be in the set" (never false negatives, small configurable false positive rate).
- Architecture: When a user queries
id = 999, the app queries the Bloom Filter in memory first:- If Bloom filter returns
false: Return 404 immediately; never query cache or database! - If Bloom filter returns
true: Check cache and fallback to DB.
- If Bloom filter returns