简体   繁体   中英

How to use Bloom Filter with AWS Elasticache (Redis)?

How to use Bloom Filter module in AWS Elasticache redis, for a local setup importing the module can help solve th issue, but I am not sure how can I use a Bloom Filter package like rebloom( https://github.com/RedisLabsModules/rebloom ) in AWS Elasticache.

You can't. But you if you get a Managed Redis from RedisLabs you are getting it built in.

See: https://redislabs.com/redis-enterprise/vpc/

You can try Redisson 's implementation of Bloom Filter. It works with any Redis vendor.

RBloomFilter<SomeObject> bloomFilter = redisson.getBloomFilter("sample");
// initialize bloom filter with 
// expectedInsertions = 55000000
// falseProbability = 0.03
bloomFilter.tryInit(55000000L, 0.03);

bloomFilter.add(new SomeObject("field1Value", "field2Value"));
bloomFilter.add(new SomeObject("field5Value", "field8Value"));

bloomFilter.contains(new SomeObject("field1Value", "field8Value"));
bloomFilter.count();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM