All Projects → Snawoot → bloom

Snawoot / bloom

Licence: GPL-3.0 license
An in-memory bloom filter with persistence and HTTP interface

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to bloom

blex
Fast Bloom filter with concurrent accessibility, powered by :atomics module.
Stars: ✭ 34 (+9.68%)
Mutual labels:  bloom, bloom-filter, probabilistic-data-structures
libfilter
High-speed Bloom filters and taffy filters for C, C++, and Java
Stars: ✭ 23 (-25.81%)
Mutual labels:  bloom-filters, bloom-filter, bloomfilter
bloomfilter
Bloom filters for Java
Stars: ✭ 53 (+70.97%)
Mutual labels:  bloom-filters, bloom-filter
exor filter
Erlang nif for xor_filter. 'Faster and Smaller Than Bloom and Cuckoo Filters'.
Stars: ✭ 29 (-6.45%)
Mutual labels:  bloom-filter, probabilistic-data-structures
bloom
Go package implementing Bloom filters
Stars: ✭ 1,752 (+5551.61%)
Mutual labels:  bloom, bloom-filters
hackernews-button
Privacy-preserving Firefox extension linking to Hacker News discussion; built with Bloom filters and WebAssembly
Stars: ✭ 73 (+135.48%)
Mutual labels:  bloom-filters, bloom-filter
bloomfilter
Bloomfilter written in Golang, includes rotation and RPC
Stars: ✭ 61 (+96.77%)
Mutual labels:  bloom-filter, probabilistic-data-structures
fastbloom
A simple but fast bloomfilter written in Python
Stars: ✭ 21 (-32.26%)
Mutual labels:  bloom-filter, bloomfilter
rust-bloomfilter
🦀 Bloom filter implementation in Rust 🦀
Stars: ✭ 18 (-41.94%)
Mutual labels:  bloom-filter, probabilistic-data-structures
bloom filter
Bloom filter implementation in Crystal lang
Stars: ✭ 33 (+6.45%)
Mutual labels:  bloom-filter
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+80.65%)
Mutual labels:  bloom-filters
redisbloom-go
Go Client for RedisBloom probabilistic module
Stars: ✭ 74 (+138.71%)
Mutual labels:  bloom-filter
bloomclj
A Bloom Filter implementation in Clojure
Stars: ✭ 20 (-35.48%)
Mutual labels:  bloom-filter
GITechDemo
Global illumination technical demo - a continuation of the Synesthesia3D (ex-LibRenderer) graphics engine used in https://github.com/iftodebogdan/ShaderEditor
Stars: ✭ 45 (+45.16%)
Mutual labels:  bloom
Doramon
个人工具汇总:一致性哈希工具,Bitmap工具,布隆过滤器参数生成器,Yaml和properties互转工具,一键式生成整个前后端工具,单机高性能幂等工具,zookeeper客户端工具,分布式全局id生成器,时间转换工具,Http封装工具
Stars: ✭ 53 (+70.97%)
Mutual labels:  bloom-filter
ganon
ganon classifies short DNA sequences against large sets of genomic sequences efficiently, with download and update of references (RefSeq/Genbank), taxonomic (NCBI/GTDB) and hierarchical classification, customized reporting and more
Stars: ✭ 57 (+83.87%)
Mutual labels:  bloom-filter
bloomfilter
bloomfilter.js ported to Go
Stars: ✭ 94 (+203.23%)
Mutual labels:  bloom-filters
pybloomfiltermmap3
Fast Python Bloom Filter using Mmap
Stars: ✭ 87 (+180.65%)
Mutual labels:  bloom-filter
cuckoo filter
High-performance, concurrent, and mutable Cuckoo Filter for Erlang and Elixir
Stars: ✭ 31 (+0%)
Mutual labels:  bloom-filter
Olivia
Go: A distributed, in-memory key-value storage.
Stars: ✭ 94 (+203.23%)
Mutual labels:  bloom-filters

Bloom

Build Status bloom

Bloom is a server, which contains Bloom filter probabilistic data structure in memory, provides access to it via HTTP and ensures data persistence on disk by mean of atomic consistent snapshots.


❤️ ❤️ ❤️

You can say thanks to the author by donations to these wallets:

  • ETH: 0xB71250010e8beC90C5f9ddF408251eBA9dD7320e
  • BTC:
    • Legacy: 1N89PRvG1CSsUk9sxKwBwudN6TjTPQ1N8a
    • Segwit: bc1qc0hcyxc000qf0ketv4r44ld7dlgmmu73rtlntw

Building

Consider also Prebuilt Docker image, binaries on Releases page to use prebuilt ones and installation from Snap Store.

Debian/Ubuntu

Run these commands in sources directory:

sudo apt-get install build-essential libevent-dev
make

RHEL/OEL/CentOS

Run these commands in sources directory:

sudo yum install gcc libevent2-devel make
make

Run make static instead of make to build static binary.

Mac OS X

Assuming you are using Homebrew

brew install libevent
make

Static build for Mac OS X is not available now.

FreeBSD

According to siege benchmarks, GCC compiler gains better performance for this application. If you want to use BSD cc, you may change CC variable in Makefile. Application can be built using both of them.

pkg install gcc libevent2
make

Run make static instead of make to build static binary.

Solaris

You have to build libevent2 before:

sudo pkg install gcc
wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz
tar xf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure
make
sudo make install

You may also need to add /usr/local/lib to library search path:

sudo crle
# Settings output here. Check output and add /usr/local/lib at the end, delimiting it by colon
sudo crle -l /lib:/usr/lib:/usr/local/lib

After that, run build of Bloom from its directory:

make

Static build for Solaris is not available now.

Installing

Prebuilt Docker image

Run:

docker volume bloom
docker run -dit \
    -v bloom:/var/lib/bloom \
    -p 8889:8889 \
    --restart unless-stopped \
    --name bloom \
    yarmak/bloom \
    /var/lib/bloom/bloom.dat

Help:

docker run -it \
    yarmak/bloom \
    -h

From source built before

make install

to install dynamic binary.

From Snap Store

Get it from the Snap Store

sudo snap install bloom

Usage

Running daemon

bloom <filename_for_snapshot> or ./bloom.static <filename_for_snapshot> if you prefer statically linked version.

Command line options:

$ bloom -h
Usage: bloom [options] SNAPSHOT_FILE

Options:

-H BIND_ADDRESS		HTTP interface bind address. Default: 0.0.0.0

-P BIND_PORT		HTTP interface bind port. Default: 8889

-h			Print this help message

-m M			Number of bits in bloom filter. Default: 2^33

-k K			Number of hash functions. Default: 10

-t SECONDS		Dump bloom filter snapshot to file every SECONDS
			seconds. You can set this value to 0 if you wish
			to disable this feature - snapshots are taken on USR1
			signal and at exit in any case.

Default settings is suitable for containing 500,000,000 elements with false positive probability 0.1%. See also Utilities for parameters calculator.

Querying

Test whether an element is a member of a set:

$ curl http://127.0.0.1:8889/check?e=sdfdsafdsafsadf
MISSING

Add an element to set:

$ curl http://127.0.0.1:8889/add?e=sdfdsafdsafsadf
ADDED

Check then add at once:

$ curl http://127.0.0.1:8889/checkthenadd?e=aaaaaabbb
MISSING
$ curl http://127.0.0.1:8889/checkthenadd?e=aaaaaabbb
PRESENT

Saving set

Server saves data to snapshot file in following cases:

  • Server exit (received SIGTERM or SIGINT)
  • Timer event. By default server dumps snapshot to disk every 5 minutes. See also help for option -t.
  • On SIGUSR1 signal. This way you may control dump process on your own by sending signal to daemon.

Snapshot dumping process does not blocks serving request and uses copy-on-write method, so dumped data is always consistent.

Utilities

  • utils/collision_meter.py - Check structure occupancy by measuring false positive probability on completely random requests.
  • utils/bf_calc.py - Calculate parameters of bloom filter for given number of elements and false positives probability.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].