How many distinct people visited a website yesterday? It sounds trivial: keep a list of the IDs you have seen, and ignore repeats. With a billion visitors that list weighs gigabytes â and you need one for every page, every hour, every region.
The obvious exact method costs memory proportional to the number of distinct items. When the stream is bigger than your machine, "just remember everything" stops being an option.
HyperLogLog, published by Philippe Flajolet, Ăric Fusy, Olivier Gandouet and FrĂ©dĂ©ric Meunier in 2007, answers the question with a stunning trade: it gives you the count to within a few percent using only kilobytes, no matter how astronomically large the true number is â and it never stores a single item.
Comments
Loading comments...