Is Node Stateful? Can Node maintain variables in memory
javascript, node.js
Solution
Yes, you can keep state in your process that persists in memory for the lifetime of the process. There are libraries available for hashmaps, LRU caches, and other commonly-used data structures.
Problem
Is Node stateful? If I want to build an index to keep in memory, will it persist throughout different connections? I'm just wondering if this is possible. For example we have a server in java that maintains a hashmap in memory to speed up certain search queries. It modifies it as things come in. Would this be possible in Node? Thanks.