Imagine you run a giant web service and, before every slow database lookup, you want to ask one quick question: "Have I ever seen this item before?" Storing every item you have ever seen would cost a fortune in memory. So you cheat â cleverly.
A Bloom filter, invented by Burton H. Bloom in 1970, answers that question using a tiny array of bits. It can hold the memory of millions of items in kilobytes. The price for this magic is a peculiar kind of honesty: when it says "no, never seen it," it is always right. When it says "yes, probably seen it," it might be wrong â a false positive.
That one-sided error is not a bug. It is the whole design. A structure that is allowed to occasionally say a confident, harmless "yes" can be astonishingly small â and that trade between space and certainty is one of the most useful bargains in computing.
Comments
Loading comments...