Explore classic, counting, and partitioned Bloom filters with a runnable CLI demo. Learn the mechanics, tradeoffs, and roadmap while keeping artifacts portable via the evergreen contract.
The Bloom filter is a probabilistic checklist that answers “have I seen this item?” with minimal memory.
{ apple, banana, cherry }
bits = 0 0 0 0 0 0 0 0 0 0
apple -> set 2,4,8
banana -> set 1,4,7
cherry -> set 3,6,9
bits = 0 1 1 1 1 0 1 1 1 1
| Variant | Why use it | Tradeoff |
|---|---|---|
| Classic | Fast membership checks for static sets | No deletions; saturates over time |
| Counting | Supports deletion via counters | Uses more memory |
| Partitioned | Distributes load across partitions | Slightly higher compute overhead |
| Scalable | Expands with new filters as load grows | More complex storage/management |
| Cuckoo filter | Low FPR with deletions baked in | More complex insertion logic |
mvn clean package
java -cp target/classes com.bloomfilter.demo.InteractiveBloomDemo
Switch modes: mode classic | mode counting | mode partitioned
mode classic
ingestlist src/main/resources/data/fruit.txt filters/
loadstd filters/fruit_Classic_m64_k3_vYYYYMMDDHHMMSS.bin
Creates a portable .bin with metadata (algorithm, bits, hashes, source, timestamp).
mode counting
ingestlist src/main/resources/data/fruit.txt filters/
check cherry
remove cherry
save filters/fruit_Counting_m64_k3.bin
Concepts covered so far: