Skip to the instrument
Sketch LabBahasa Indonesia

Answer questions about more data than you can store.

A Bloom filter, a Count-Min sketch and a HyperLogLog each answer one question about a stream of data — without keeping the data. This site runs them beside the exact structures, so you can watch both answers at once and see exactly what the shortcut costs.

An exact set of a billion URLs is tens of gigabytes and lives on disk. A filter answering questions about the same billion URLs is a few hundred megabytes and lives in memory. That is the whole trade, and it is made on purpose.

Start with the Bloom filterthe simplest of the four, and where the asymmetry is clearest
Bit arrayillustration — 128 bits

One item → three slots, addressed by three hashes. One of them was already set by an earlier item — which is why a “yes” is only ever a hint, and a “no” is proof.

Exact set — modelled
76.29 MiB
Bloom filter — allocated
1.14 MiB

1,000,000 URLs at a 1% false-positive rate, 7 hashes. The filter figure is what the sizing formula allocates; the exact figure is lib/exact’s per-entry model, and is labelled modelled because a Set’s real footprint belongs to the engine.

Structures

or pick one below

The bargain

Every one of these structures makes the same bargain: hash into a fixed-size array, accept that collisions cause bounded damage, and stop storing the items at all.

Memory stops growing with the data. The price is an error rate — calculable in advance, and therefore a design parameter rather than a defect.

Asymmetry

Each guarantee is one-sided, and the direction matters. A Bloom filter’s “no” is proof; its “yes” is a hint. That asymmetry is why a database can use one to skip disk reads safely — a wrong “yes” costs a wasted read, a wrong “no” would lose data, and a wrong “no” cannot happen.

Tools