connect.Session() MemoryStore is not designed for a production environment. Now what?

If the connect.session() MemoryStore is not designed for a production env, what should I do to avoid memory leaks and to scale past a single process on my server.js code? Do I need to switch NODE_ENV to staging or test?

Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.

The project I am talking about this issue was eastern-preface.

I believe the NPM package memorystore should solve this issue. It replaces the MemoryStore object with one that doesn’t leak memory.

1 Like