NodeJS - best practices to handle in-memory data?

344 Views Asked by At

I'm building an app that heavily relies on in-memory data. It listens to 3rd party app via WebSockets and keeps up the in-memory state.

I have been thinking libraries like redux would be a great choice, even tho it is built for the frontend.

However, normally, backends are stateless so I'm having second thoughts on redux and maybe there's a more elegant choice to handle states/in-memory data in NodeJS?

The second option I have been looking at is LokiJS https://github.com/techfort/LokiJS

Thoughts?

UPDATE

I do use typescript, and what I'm going to store in memory is classes, so LokiJS may not be suitable since it is more designed for storing documents. Just my two cents, tho

0

There are 0 best solutions below