For those who don’t know there’s a data structure called a HyperLogLog (https://en.m.wikipedia.org/wiki/HyperLogLog) that does something similar. Just learned about it last week.
This counting bloom filter lets us estimate about how many times we’ve encountered a particular element in some huge set using a relatively small amount of memory.
So we’re answering two different questions with these guys:
Counting bloom filter: About how many times has a particular element shown up in this set?
(Hyper)LogLog: About how many unique elements are in this set?