Probabilistic data structures in Go

25 points by cgrinds


fanf

When I investigated quantile statistics a few years ago, I came to the conclusion that a histogram with log-linear bucketing is much simpler to implement than a T-digest, and more useful and easier to understand from an operational point of view. Log-linear bucketing corresponds to the kind of scientific notation x.yz * 10^e that is taught in high school, so 3 s.f. or a max 0.1% value error is reasonably straightforward and familiar. This kind of histogram can record outliers fairly cheaply, which is helpful because those are usually the most interesting values.

By contrast quantile sketches such as T-digest target a rank error (as opposed to a value error). The effect is that if you care about the 99.9% or 99.99% oddities, the sketches get big and waste space on the middle ranks, and you still lose information about the value of the outliers. It ends up not being competitive in terms of space or speed or precision compared to a histogram.

fanf

There’s a relatively new and simpler alternative to HyperLogLog for cardinality estimation that Knuth called the CVM algorithm (after its authors) https://buttondown.com/jaffray/archive/the-cvm-algorithm/

Doctor-X

These are so cool! I know Bloom filters, so thank you for introducing me to the others.