Giter Site home page Giter Site logo

albert-team / rebloom Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 6.0 436 KB

Minimalistic RedisBloom client for Node.js

Home Page: https://albert-team.github.io/rebloom

License: MIT License

TypeScript 72.65% JavaScript 27.35%
javascript minimalistic nodejs redisbloom typescript

rebloom's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rebloom's Issues

RedisBloom was updated with several new features

Hello and thank you for maintaining this client,
Most features are additional options during the creation of Bloom and Cuckoo filters but a change that may break your clients is - CMS.INCRBY returns count instead of OK.
Regards,
Ariel

Connection timeout.

Hi @lqmanh, thanks for your work !

We are trying to use you library, but we are facing to timeout on each attempt to connect using both bloomfilter and cuckoofilter.

Maybe something is wrong on our side but even with a localhost redis and all params to default we are facing this issue.

Many thanks for your help !

TypeError: Cannot read property 'addResponse' of undefined\n

  • Redis 5.0.3
  • RedisBloom 2.2.4
  • OS Centos 8.3
  • rebloom latest

Should be an uncapped exception i use Bull to exec some tasks and bull task failed reason

  • stacktrace
stacktrace: [
    "TypeError: Cannot read property 'addResponse' of undefined\n" +
      '    at JavascriptRedisParser.returnReply (/root/apps/api/node_modules/@albert-team/red/src/index.js:61:19)\n' +
      '    at JavascriptRedisParser.execute (/root/apps/api/node_modules/redis-parser/lib/parser.js:544:14)\n' +
      '    at Socket.<anonymous> (/root/apps/api/node_modules/@albert-team/red/src/index.js:95:41)\n' +
      '    at Socket.emit (events.js:326:22)\n' +
      '    at addChunk (_stream_readable.js:297:12)\n' +
      '    at readableAddChunk (_stream_readable.js:272:9)\n' +
      '    at Socket.Readable.push (_stream_readable.js:213:10)\n' +
      '    at TCP.onStreamRead (internal/stream_base_commons.js:188:23)'
  ]
  • code like
try {
    await some_filter.connect()
    logger.info(`some_filter connect`)
    await other_filter.connect()
    logger.info(`other_filter connect`)
    // do some exists check and add
} catch (err) {
    // It didn't arrive here
    throw err
} finally {
    try {
        await some_filter.disconnect()
        logger.info(`some_filter disconnect`)
        await other_filter.disconnect()
        logger.info(`other_filter disconnect`)
    } catch (e) { }
}

Confusion Regarding Bloom Filter Settings

I tried to find what are the default options for rebloom

But couldn't find anything.

The doubt's which I had in my mind are

  • How many hash functions are used in the filter that is created?
  • Can we configure the size of the filter?
  • Is there any way to configure number of hash functions to use for less space consumption?

Thanks

add some other examples maybe helpful

const { BloomFilter } = require('@albert-team/rebloom')
const main = async () => {
const filter = new BloomFilter('filtername')
await filter.connect()
console.log(await filter.add('item0')) // 1
console.log(await filter.exists('item0')) // 1
console.log(await filter.exists('item1')) // 0
await filter.disconnect()
}
main()

if i want to connect remote redis,how should i modify this code,how I add Options params ,if have some examples maybe helpful!

RedisBloom got extension for two additional datatypes...

It will be great if you could update this client to support it.
There is a python client which up to date and additional documentation about both count-min sketch and topk.
The repository was linked on RedisBloom main page.
Thank you for the support.

Support for T-Digest data structure

Given RedisBloom/RedisBloom#285 there is the following set of commands we should enable:

  • TDIGEST.CREATE: Allocate a new histogram
  • TDIGEST.RESET: Empty out a histogram and re-initialize it
  • TDIGEST.ADD: Add a value to the t-Digest with the specified count
  • TDIGEST.MERGE: Merge one t-Digest into another
  • TDIGEST.CDF: Returns the fraction of all points added which are โ‰ค x.
  • TDIGEST.QUANTILE: Returns an estimate of the cutoff such that a specified fraction of the data added to the t-Digest would be less than or equal to the cutoff.
  • TDIGEST.MIN: Get the minimum value from the histogram. Will return DBL_MAX if the histogram is empty
  • TDIGEST.MAX: Get the maximum value from the histogram. Will return DBL_MIN if the histogram is empty
  • TDIGEST.INFO : Returns compression, capacity, total merged and unmerged nodes, the total compressions
    made up to date on that key, and merged and unmerged weight.

With the in-depth params in https://oss.redislabs.com/redisbloom/master/TDigest_Commands/

[Question] An example of TopKFilter

Could you provide an example of TopKFilter, which is to my understanding an algorithm that could find top items in a stream.
My case is user searches on a website, so items are Strings.
Many thanks !!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.