duanfanta6741 2014-04-02 00:31
浏览 296

Redis和Go中的MongoDB ID布隆过滤器

I'm working on articles suggestions. There are lots of them. Think about YouTube videos suggestions. To avoid suggesting article once again I'd like to remember which were seen already by particular user. I have lot's of users and I'd like to avoid infinitely growing database of history as well.

Every article has MongoDB ObjectId. I use Redis and Go language.

I think that Bloom Filter could solve this problem, because false positives are ok in this case. I'd like to avoid false negatives, but it's not 100% obligatory.

I don't know any sensible alternative to Bloom Filter in this area. Should I?

I can't find any implementation of Bloom Filter for Redis in Go. Can somebody advice me is it the best choice, how can I write my own or is there any existing implementation?

  • 写回答

2条回答

  • dongya2578 2015-07-22 05:54
    关注

    For anyone stumbling across this post, if you're using Redis in this situation, then you probably want to use its HyperLogLog feature; Antirez wrote about it at length here. No need to figure out how to make a bloom filter in Redis, it has something just as good built in (and it can also tell you approximately how many items have been inserted in it).

    评论

报告相同问题?

悬赏问题

  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题