How count-min sketches work – frequencies, but without the actual data(instantdb.com)
instantdb.com
How count-min sketches work – frequencies, but without the actual data
https://www.instantdb.com/essays/count_min_sketch
7 comments
Nice setup with the Wodehouse. There are lesser-used sketches beyond the basic Bloom, HyperLogLog, and count-min. Maybe for another article.
Cool! How did you do the reactive demos on the site? I assume it was with instantDB? How hard was it to integrate into a blog post?
Thank you!
Since all the reactive demos are local, I didn't add Instant in this case.
One little trick I did for data was here:
https://github.com/instantdb/instant/blob/main/client/www/co...
Mainly: I wanted to get all counts for Wodehouse, but didn't want to block the page load for that. So what I did was take a small subset of the data that's needed to render the page, and have that written into the file. Then after load I fetch all the other counts.
In the tutorial I also used Bun.xxHash3, but to make sketches run on the client, I had to replace that with a library.
The actual sketch implementation that backs the demos is here:
https://github.com/instantdb/instant/blob/main/client/www/co...
Since all the reactive demos are local, I didn't add Instant in this case.
One little trick I did for data was here:
https://github.com/instantdb/instant/blob/main/client/www/co...
Mainly: I wanted to get all counts for Wodehouse, but didn't want to block the page load for that. So what I did was take a small subset of the data that's needed to render the page, and have that written into the file. Then after load I fetch all the other counts.
In the tutorial I also used Bun.xxHash3, but to make sketches run on the client, I had to replace that with a library.
The actual sketch implementation that backs the demos is here:
https://github.com/instantdb/instant/blob/main/client/www/co...