I have a need to store some meta-data in a node.js application I am writing. Rather than come up with my own file format and managing that file, I would like to use an in-process persistant key-value store.
I was looking at mongodb but it seems that mongodb must always be run out-of-process (that is, you need to start a mongo server first, then connect to it in node.js.) I require that whatever store this is, that it exist entirely within the node.js process - or at least that any external processes are entirely managed transparently by the library, and kills them when the application closes the connection.
I don't care much about performance, but it would be nice to support asynchronous IO to the store to keep up with Node's whole async thing.
It would also be nice if the store supported indexes, as I will definitely be querying the data in a way where indexes would be helpful.
I'm pretty sure that 'sqlite' would work for me, except that I don't really see it as being nearly as convenient as a key-value store. Ideally I should be able to speak in JSON, not SQL. But sqlite will work if nothing better exists.
Thanks!
Try nStore.
https://github.com/creationix/nstore
It's in process key-value store. Simple to use as well.
Take a look to https://github.com/sergeyksv/tingodb. It is closely compatible to MongoDB API so you can upgrade to MongoDB when you'll need it.
You might be interested in using redis http://redis.io/
There is a popular helper library for node https://github.com/mranney/node_redis
Then you can do this:
var redis = require("redis");
var client = redis.createClient();
client.set("foo_rand000000000000", "OK");
I think you might be interested in final-db.
FinalDB uses file system to store it's data. It's not key-value store but document-based nosql solution. It supports indexes (maps) - you can specify map functions on each collection and of course it's an in process solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With