I have a small project that I was using node-dirty for, but it’s not really for production use and I’ve had way to many surprises with it so I would like to switch. I was looking at using sqlite, but compiling a client for it seems troublesome. Is there something like node-dirty (i.e. a pure Node.js implementation of a data store), but that’s more suited for a small project that doesn’t have more than a few hundred sets of data. I’ve faced the following problems with node-dirty that I would expect an altenrative data store not to do:
- Saving a Date object makes it come out as a string when reloading the data (but during execution it remains a Date object). I’m fine with having to serialize the Date object myself, as long as I get out the same thing it lets me put into it.
- Iterating over data and deleting something in the same forEach loop makes the iteration stop.
- My client is reporting deleted data re-appearing and I’ve intermittently seen this too, I have no idea why.
How much data do you have? For some projects it’s reasonable to just have things in memory and persist them by dumping a JSON file with all the data.