Bloom Filters : A Beginner’s Guide #### Bloom Filters
---------------------------
**Ever wondered how**
- a Website with a massive user base could determine whether a username is taken or not in milliseconds?
- How does `Chrome` checks if the url you are visiting isn't malicious without comparing it against a bulky list of URLs?
- How `Quora` filters out posts you have already seen ?
---------------------------
So the problem here is ultimately you have a set of billions of strings, and a server needs to check whether a string passed to it by the client exists in the set or not.
Straightforward but Not so Good Ways : Considering we have `N strings` and the `average length` of each string is `L`.
**Linear search**
- O(N*L) Search Time Complexity, Iterate over all the strings and compare and see if the string is present.
- O(N*L) space complexity.
**Binary search**
- backed by a `Red-Black Tree / balanced BST`
- O(L × log n) Search Time Complexity, Each comparison in the tree takes O(L), ...
Bloom Filters : A Beginner’s Guide, where a `Bloom Filter` can be helpful: **Concept**: - Bloom Filter is a
`probabilistic data, #### Bloom Filters ---------------------------, - Bloom Filter is a `probabilistic data structure` that uses bits to determine
whether an item, - The drawback of the Bloom filter is we cannot delete elements from the list
by just clearing the, . - The `set bits indexes` passed to the server will act as the `filter`. - It
iterates over all the, Here is where a `Bloom Filter` can be helpful:
Full text and comments »