5 ms·
What's wrong with using a plain file?
by orf 10y ago
What's wrong with using a plain file?
- Kiro 10y agoIt would probably work but in my real application it's a bit more complicated since I only want to update a sub-array of the document, like this: collection['some_identifier']['items'][3] = 123. I guess using a plain file would mean I have to overwrite everything on each write which seems wasteful.
- orf 10y agoSure, it depends on your use case though. For infrequent updates I don't think it's wasteful to just overwrite the file, it seems less wasteful to me than running a whole database. But it all depends on your setup :) Also I think updating a sub array in a collection triggers a whole write to that collection in mongodb. In any case I would avoid mongodb if you can, it seems redis might be a better fit for you.
- elmigranto 10y agoThis should read "plain SQLite file". At least it'll handle serialization and FS failures for you.