← All questions
Data, Privacy & LegalMedium· Data Structures· Memory Optimization

What is a Bloom filter, and why use one instead of a ha...

A Bloom filter supports membership tests without the ability to store keys or iterate over them. While a hash set for 10^10 items might require 80 GB of RAM, a Bloom filter with a false positive rate of 10^-9 can achieve the same task with approximately 54 GB of bits. It has no false negatives, and the false positive rate is tunable via the number of hash functions used. This makes it ideal for deduplication tasks where you only need to verify if an item has been seen before.

Code playground (Python)