Git Product home page Git Product logo

memored's Issues

questions

Hi , I liked this project a lot. couple of questions:

  1. where do you save the data? on the main process memory or on the disk?
  2. is it possible to work with it without cluster? i.e only with main process?

Thanks,
Guy

High Load Server

Hello everyon. Could you tell me, how memored work with high load servers?

The load of my server equal 1 billion request per day. How I understand first I have to add require('memoried') to master script, then I have to add it to workers lib.

I think Server Master could drop under pressure of traffic.

Other data structures

Hey there,

I was searching for a way to share data between cluster workers and found your project.

I don't want to increase the complexity of my architecture by adding Redis as a dependency, but I need support to more advanced data structures though, like lists maps, etc.

Do you plan to support those in your library? Cheers.

Several domains

Is there a way, to add several domains of cache?

let memored = require('memored')

let cache1 = new memored();
cache1.setup({ domain: "ipV6", purgeInterval: 3 * 60 * 60 * 1000});

let cache2 = new memored();
cache2.setup({ domain: "ipV4", purgeInterval: 24 * 60 * 60 * 1000}});

Just a comment

I am writing this comment to commend the writer of this module.

It is really good for clusters management in Node.js. It scales so well to several applications.

  1. I have been using it with mongoDB and it gives excellent in-memory session management.
  2. I have also used it to handle data manipulation in a real-time "scientific/numeric computation" application.

It is very small and compact.

I have been using it for over 4 months now and I can't believe the excellent performance I am getting from it, especially with well structured IIFE codes (https://en.wikipedia.org/wiki/Immediately-invoked_function_expression).

I hope the author can write a small book on this module to let people know of its functionalities.

why i cant add below object?

{

    DefaultFlow: require('./shared/defaultFlow/defaultFlow'),
    DefaultFlowChild: require('./shared/defaultFlow/defaultFlowChild'),
    User: require('./auth/user'),
    Task: require('./shared/Task/task'),
    Process: require('./shared/Task/process'),
    Workflow: require('./shared/Task/workflow'),
    Message: require('./shared/Message/message'),
    Mail: require('./official/mail/mail'),
    Fat: require('./technical/panel/fat'),

}

Storing keys from master

Is it possible to store keys in the master and have child processes access the data? I have a long running process I only want run as one instance, and in a multi-cpu server I would have that process running multiple times unnecessarily consuming resources.

Question about master

Is there any reason the master cant have access to the cache data (or even the cache itself)? It looks like the cache will return keys and can be cleared via reset(). I was looking to show the cache contents (from an express server running in the master) just for status/debugging, but the best i can do is show the keys. Thanks!

Typescript-file

I created a Typescript-Definition file .. so maybe you can add it in your lib (https://stackoverflow.com/questions/37210059/how-to-add-a-typescript-definition-file-to-a-npm-package).

declare module "memored" {

    // https://github.com/PaquitoSoft/memored#setupoptions
    export interface IMemoredLogger {
        log: (message: string) => any
        warn: (message: string) => any
    }
    function setup<T extends IMemoredLogger>(options?: { purgeInterval?: number, logger?: T }): void

    // https://github.com/PaquitoSoft/memored#storekey-value-ttl-callback
    function store(key: string, value: any, ttl: number, cb?: (err: Error, expirationTime: number) => any): void
    function store(key: string, value: any, cb?: (err: Error | null, expirationTime: number) => any): void

    // https://github.com/PaquitoSoft/memored#multistoremap-ttl-callback
    interface IMultiKeyValue {
        [index: string]: any
    }
    function multiStore(IMultiKeyValue: IMultiKeyValue, ttl: number, cb?: (err: Error
                                                                               | null, expirationTime: number) => any): void
    function multiStore(IMultiKeyValue: IMultiKeyValue, cb?: (err: Error | null, expirationTime: number) => any): void

    // https://github.com/PaquitoSoft/memored#readkey-callback
    function read(key: string, cb: (err: Error | null, value: any) => any): void

    // https://github.com/PaquitoSoft/memored#multireadkeys-callback
    function multiRead(keys: Array<string>, cb: (err: Error | null, values: IMultiKeyValue) => any): void

    // https://github.com/PaquitoSoft/memored#removekey-callback
    function remove(key: string, cb?: () => any): void

    // https://github.com/PaquitoSoft/memored#multiremovekeys-callback
    function multiRemove(keys: Array<string>, cb?: () => any): void

    // https://github.com/PaquitoSoft/memored#cleancallback
    function clean(cb?: () => any): void

    // https://github.com/PaquitoSoft/memored#sizecallback
    function size(cb: (err: Error | null, size: number) => any): void

    // https://github.com/PaquitoSoft/memored#keyscallback
    function keys(cb: (err: Error | null, keys: Array<string>) => any): void
}

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.