System design

Stage 1 · Lesson 10 of 10

Bloom filters

Core concepts and building blocks

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

  • CoursePaid
    Grokking 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 repoFree
    The System Design Primer

    Donne Martin · Intermediate

    Free: its scalability, latency, availability, CDN, load balancer and cache sections

Keep handy

  • Free Design Gurus concept index for looking up a term in the middle of a lesson

Also worth your time

Mark this stage as not done?