What is RedisBloom (Bloom Filter in Redis)?
Answer
A Bloom Filter is a probabilistic data structure that answers "Is this element in the set?" with either definitely not or probably yes. It uses a fixed amount of memory and has zero false negatives but a configurable false positive rate. RedisBloom is a Redis module (part of Redis Stack) that adds Bloom Filters natively. BF.ADD key element adds to the filter; BF.EXISTS key element checks membership. Bloom Filters are ideal for cache-miss optimization: before hitting the database for a key, check the Bloom Filter — if it says "not present," skip the database entirely, preventing cache penetration attacks (malicious requests for non-existent keys). They are also used in duplicate URL detection, username availability checks at scale, and spam filtering.
More Redis Questions
View all →- Intermediate What is Redis Cluster and how does it shard data?
- Intermediate What is the difference between Redis Sentinel and Redis Cluster?
- Intermediate How do MULTI and EXEC work in Redis transactions?
- Intermediate What is WATCH and optimistic locking in Redis?
- Intermediate What is Lua scripting in Redis and when should you use it?