Basically you should use a distributed sorted set to store the hits. Redis is much more powerful than most people think (I know a lot of people just consider it as a giant hashmap) Either solution 1 or 2 in the following SO answer would work: https://stackoverflow.com/questions/25706925/how-do-i-implement-temporal- leaderbords-with-redis However as a design question, you should also consider persisting the original hit data in blob storage so if Redis crashes, you can revive it by replay the data. If you need a top-K hit counter for over 1 day period, I would suggest you to add some offline processing, and aggregate the realtime part on the flight. Which makes the whole system a Lambda Architecture: https://en.wikipedia.org/wiki/Lambda_architecture
: However as a design question, you should also consider persisting the
: original
: hit data in blob storage so if Redis crashes, you can revive it by replay
: the data.
【在 r*****s 的大作中提到】 : Basically you should use a distributed sorted set to store the hits. Redis : is much more powerful than most people think (I know a lot of people just : consider it as a giant hashmap) : Either solution 1 or 2 in the following SO answer would work: : https://stackoverflow.com/questions/25706925/how-do-i-implement-temporal- : leaderbords-with-redis : However as a design question, you should also consider persisting the : original : hit data in blob storage so if Redis crashes, you can revive it by replay : the data.