🔴 Redis Intermediate

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.