Menu

1 / 2

🌸 Bloom Filters Explained Like You're 5

DEV CommunityΒ·Sreekar ReddyΒ·6 months ago
#f1luEnjJ
#eli5#datastructures#probabilistic#bloom#filters
Reading 0:00
15s threshold

Probably yes or definitely no

Day 139 of 149

πŸ‘‰ Full deep-dive with code examples

The Nightclub Bouncer Analogy

Imagine a nightclub bouncer with a list:

"Is this person on the banned list?"

Instead of checking the whole list, they have a quick mental system

Sometimes they might say "maybe on the list" when they're not

In a standard Bloom filter (with consistent hashing and only additions), they won't say "definitely not" when someone actually is in the set

Bloom Filters work like this bouncer!

Fast to check, might have false positives, and (in the standard version) no false negatives.

More precisely: in standard use (only adding items, consistent hashing, no corruption), Bloom filters are designed to avoid false negatives.

The Problem They Solve

Checking if something is in a huge set can be expensive (especially if the data lives on disk or across the network):

"Has this user already seen this article?"

"Is this email address in our database?"

"Is this URL malicious?"

Bloom filters help you…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.