33

Redis 精确去重计数 —— 咆哮位图

 4 years ago
source link: https://juejin.im/post/5cf5c817e51d454fbf5409b0
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
如果要统计一篇文章的阅读量,可以直接使用 Redis 的 incr 指令来完成。如果要求阅读量必须按用户去重,那就可以使用 set 来记录阅读了这篇文章的所有用户 id,获取 set 集合的长度就是去重阅读量。但是如果爆款文章阅读量太大,set 会浪费太多存储

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK