HyperLogLog for counting unique elements with fixed memory
Counting unique visitors sounds like a small task until the numbers grow. Every distinct ID has to be remembered, every new visit needs a check against the ones already seen and memory keeps rising with each new person. HyperLogLog is an algorithm that skips the remembering. It estimates how many different items went through a stream while keeping a few kilobytes of state and in return it accepts a small error that can be measured in advance.