I want to use persistant database for purpose of caching, so that even after my Node.js programs shuts down, values are still there in cache and when the program is started back up, it takes it's values from there only. I am looking at a few modules but evaluating each modules takes time.
I already checked out Redis but it doesn't fit the bill as I want to store JSON packets but it doesn't support JSON out of the box and demands considerable preprocessing. Would love to know from the community what they are using to solve a similar issue and what is the most favoured/easy to work with player.
I prefer redis. For json you could do something like
JSON.stringify(<MyJson>)
and when getting it out:
JSON.parse(<MyJsonString>)
Maybe not the best solution, but it should work.
Sandeep Panda
co-founder, Hashnode
We are using Redis at Hashnode. If you turn on disk persistence, Redis will save the data on disk periodically. And in case of a restart, it'll read the data from disk and populate the cache. If you are working with JSON, you can simply stringify the object and store it in a key. Another option is to use hmset and hmget to directly store and retrieve hashes.
Since you are using Node.js, node_redis is a great library for interacting with Redis.