2026-11-25
Hi! Long time no see. Hope you are doing well.
I'm Anton. I work on open source and write interactive technical guides.
You're receiving this email because you subscribed to my updates at antonz.org/subscribe. If you'd like to unsubscribe, use the link at the bottom of this email.
Lately, I've been interested in probabilistic data structures. They give you approximate answers to questions about the data they handle. Does the set contain a certain item? How many unique items are in the collection? Which items appear most often? Unlike deterministic structures like sets and frequency tables, the answers are not exact, but in return, you can drastically reduce memory usage.
As a result, I created unsure — a package that implements these structures in Go. It's simple (the core logic for each data structure is 100–300 LOC), fast (often several times faster than other implementations), and has no dependencies except for the standard library.
Here are the data structures it covers:
Bloom filter and Binary fuse filter check if an item might be in a set. The binary fuse is more compact, but unlike Bloom, it can't be changed after creation.
Count-min sketch estimates how many times each item has occurred.
HyperLogLog and UltraLogLog estimate the number of distinct items. UltraLogLog is more compact, but HyperLogLog is faster.
MinHash estimates how similar two sets are.
T-digest and Log-linear histogram estimate quantiles of a stream of numbers. The t-digest is more compact, but the histogram is more accurate.
Top-k sketch finds the most frequent items in a stream.
If you have a task where you are ready to trade some accuracy for size, I invite you to try them!
On a completely unrelated note, my books — Gist of Go: Concurrency and SQL Window Functions Explained — are currently on sale at a decent discount. Use the code 2LTCTEE at checkout if you are interested.
That's all for now. See you in the next episode!
Anton
Don't miss what's next. Subscribe to Anton Zhiyanov: