4 ms·
Basically any database should do for this usecase. A simple key-value store probably best. I'd aim for keeping the technological complexity as low as possible.
by Fannon 10y ago
Basically any database should do for this usecase. A simple key-value store probably best. I'd aim for keeping the technological complexity as low as possible.
What is the simplest tool to do the job?
Or maybe better yet: Use something that's already (or will be), in your technology stack to avoid having one more thing in it.
- Kiro 10y agoThanks! > What is the simplest tool to do the job? For me it's definitely MongoDB but I'm afraid of data loss etc. My example was simplified. In reality I want to update a sub-array within the collection, like this: collection['some_identifier']['items'][3] = 123. Overwriting the whole 'some_identifier' document seems wasteful. With MongoDB it's easy though to update nested sub-data.
- elmigranto 10y agoIf you ever only need to read or update single document in a single collection, Mongo's fine. When you need anything more (which is probably "soon" if not "already"), it'll bite one way or the other.
- threeseed 10y agoThis absolutely isn't true. If you batch operations it is extremely fast at updates across multiple documents.
- elmigranto 10y agoPoor wording on my part. My point isn't about performance, it's about API. Other than selecting documents from single collection (.find), Mongo's queries are shockingly wierd and inconsistent to me. Compare aggregation framework to what SQL has, for example: https://docs.mongodb.com/manual/reference/sql-aggregation-comparison/ https://docs.mongodb.com/manual/reference/sql-aggregation-co... Or even within Mongo, querying and aggregating are astonishingly different things, that you need to learn separately. And then there are JOINS. And stale reads with other serialization issues.