在Node.js服务器上的内存存储中

问题描述:

似乎有很多有前途的软件包,但没有明确的建议,哪些是最快,可扩展的,以及哪一种是内存效率更高的.

There seem to be quite a few promising packages with no clear suggestions on which is the fastest,scalable and which is more memory efficient.

  1. npm install memoizee
  2. npm install 内存缓存
  3. lru-cache
  4. npm install 内存缓存
  5. npm install 节点缓存
  1. npm install memoizee
  2. npm install memcached
  3. lru-cache
  4. npm install memory-cache
  5. npm install node-cache

任何可靠的信息/个人经验来源都将有所帮助.
因此,基本用法是用于简单的key:value store.
只需知道这些不同商店的基础体系结构是否相似/不同,以及是否不同即可扩展.

Any reliable sources of information/personal experience with these would help.
So the basic usage is for simple key:value store.
Just need to know if the underlying architecture of these different stores is similar/different and if different then which would be scalable.

[此外, express-session 使用其中的哪些来实现 MemoryStore .]

[Also which of these is used by express-session to implement the MemoryStore.]

express-session的依赖项直接在Github的

The dependencies for express-session are right on Github in its package.json. I don't see any of your listed storage mechanisms.

然后,如果您查看MemoryStore对象的代码在这里,您可以看到它只是使用Javascript对象来存储由sessionId索引的会话列表.

Then, if you look at the code for the MemoryStore object here, you can see that it's just using a Javascript object to store a list of sessions indexed by sessionId.