R
R
RoflanDaniil2017-10-23 18:43:56
JavaScript
RoflanDaniil, 2017-10-23 18:43:56

How to store data in the Node.js process and not lose it when it crashes?

I want to store all the data in the node process, because it is long-lived. How to implement data exchange between several processes and not lose any information if the process dies?
Is it possible to do without an external database at all? Even without the radish.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Korobkov, 2017-10-23
@RoflanDaniil

If you store only in RAM (node ​​process) - when the process ends, everything will be lost.
If you need to save data outside the process, that is, in non-volatile memory - this is called a hard disk (self-written database on files, mysql / postrgesql, redis, rabbitmq or something else - it doesn’t matter).
Data exchange between processes:
- fast, but with loss at the end of the script - via sockets.
- a little slower, but reliable - via hard disk storage.

S
Sergey, 2017-10-26
@phper

https://gist.github.com/jpoehls/2232358

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question