| Data Structure |
Set membership: „Have I seen this item before?“ |
Frequency estimation: “How many of this kind have I seen?” |
Cardinality estimation: “How many distinct items have I seen in total” |
Item removal |
Persistence and distributed access |
| Memory Bloom Filter |
Yes, with configurable false positive probability, O(1) |
No |
Yes, O(#bits) |
No |
No |
| Memory Counting Bloom Filter |
Yes, with configurable false positive probability, O(1) |
Yes (Minimum Selection Algorithm), O(1) |
Yes, O(#bits) |
Yes, O(1) |
No |
| Redis Bloom Filter |
Yes, with configurable false positive probability, O(1), single roundtrip, scalable through read slaves |
No |
Yes, O(#bits), single roundtrip, scalable through read slaves |
No |
Yes, configurable Redis persistence & replication |
| Redis Counting Bloom Filter |
Yes, with configurable false positive probability, O(1) , single roundtrip, scalable through read slaves |
Yes (Minimum Selection Algorithm), O(1) , single roundtrip, scalable through read slaves |
Yes, O(#bits), single roundtrip, scalable through read slaves |
Yes, O(1), in average 2 roundtrips |
Yes, configurable Redis persistence & replication |
| Other sketches (not part of this lib) |
Hashsets, Bitvectors |
Count-Min-Sketch, Count-Mean-Sketch |
K-Minimum-Values, HyperLogLog |
|
|
Up next
==========
- Compatible Javascript implementation which can consume the JSON Bloom filter representation
- Redis Bloom filters that leverage Redis Cluster (once it's ready)
License
=======
This Bloom filter library is published under the very permissive MIT license:
Copyright Felix Gessert and Florian Bücklers. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.