Redis › HyperLogLog in Redis
How would you design an analytics system using HyperLogLog to track unique visitors across multiple time periods, such as daily, weekly, and monthly counts?
AdvancedAnswer
You would create a separate HyperLogLog for each day, add visitor identifiers to the appropriate day's structure as they occur, and then use PFMERGE to combine the relevant daily structures into weekly or monthly HyperLogLogs whenever those aggregated counts are needed, avoiding the need to reprocess raw visitor data for every different time period you want to report on.
PFADD visitors:2026-09-07 'user123'
PFMERGE visitors:week36 visitors:2026-09-01 visitors:2026-09-02 -- and so onReal-world example A media company tracks daily unique visitor HyperLogLogs throughout the month, merging them into weekly and monthly rollups on demand, giving their analytics team flexible reporting across multiple time granularities without reprocessing raw visitor logs.