Stage 1 · Lesson 10 of 10
Bloom filters
A answers one question: "is this item possibly in the set?" It uses a row of bits (a bit array) and a few , which turn an item into positions in that row. It needs a tiny fraction of the memory a real set would.
Adding an item sets k bits to 1. Checking an item tests those same k bits. If any bit is 0, the item is definitely not there.
If all are 1, it is probably there. The chance of a wrong "yes", a , depends on how big you make the array: for example, about 1% at under 10 bits per item. It never gives a wrong "no" (a false negative), and a basic one cannot delete items.
Databases such as use them to skip disk files that cannot contain a key. Web crawlers use them to avoid revisiting . Use one only where an occasional false positive is cheap.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking System Design Fundamentals
Design Gurus · Beginner · Subscription
Load balancing, API gateway, proxies, caching, CAP and Bloom filters: week 1 of the plan in order
- GitHub repoFreeThe System Design Primer
Donne Martin · Intermediate
Free: its scalability, latency, availability, CDN, load balancer and cache sections
Keep handy
Also worth your time
Why CAP only describes partitions, and what PACELC adds for normal operation