Why you should never, ever, ever use MongoDB
cryto.net
cryto.net
The bigger issue I've seen was that some major ORMs were relying on some (apparently undefined?) behavior regarding the positional operator with nested collections of documents, and that behavior changed with a minor version. It's harder to blame MongoDB for that one, but the data corruption was cancerous – it multiplied on every document save.
{"a": 1, "a": 2, "b": 3}
"a" maps to 2 different values in this case. Depending on how your languages driver works it's often difficult to see this is happening. In some languages you'll get "a" mapped to 1, and other languages will show "a" mapped to 2.
It is still the case (and will remain for a long time -- also internet years) that to get reliable behavior, you need to use non-default options. Queries need a variety of extra flags that say, "please make this write durable", or "please be sure to give me the right answer". And, when you use the flags, they reliably make the DB slower. If you use enough of them to get ACIDy distributed reliability, it's hardly faster than other DBs.
So, in another two or three years, it will be an OK choice. In the meantime, PostgreSQL is arguably the better choice. And, of course, PG is not sitting still, so may still be a better choice in two or three years.
But most people using MongoDB don't care, because the overwhelming majority of uses of data storage just don't matter very much. When you see the list "people who bought this gewgaw also looked at this lot" on the bottom of a page, chances are that's Mongo telling you, and who cares if it's right? What matters is you didn't have to wait an extra ten seconds for the stupid page to load.
Still! Every time you order from Cisco, the order goes through a Mongo store. Since they have been using Mongo for a long time, they either make durability in their application code -- which, dangerous secret, is much easier than doing it in the DB -- or just aren't too arsed about it. (I'm betting it's the latter.)
A technical comparison is here, but it's on the couchbase site so it could be biased https://www.couchbase.com/comparing-couchbase-vs-mongodb
All the other points are interesting, but I'm really tired of people bringing up this fact as a slam against NoSQL databases. Not everyone needs ACID compliance.
Edit: link https://blog.meteor.com/-654b6594a827
I was thinking that one approach might be first to just keep the schema-less data model and move over to using Postgres JSON. Once that is stable, then think about how we would move over to using schemas. Any thoughts on whether that is a plausible approach?
The company I worked for until recently maintains a core data store in Mongo, but mirrors the content into a Postgres database for use by other, newer applications (which don’t modify the data).
We built a tool which streams the MongoDB Oplog into tables containing a JSONB column for the document - https://github.com/mudge/oplogjam - and it has been pretty good to work with. Sefilitely am approach than can work well in my experience, though!
2. We didn't want to introduce MongoDB and then having to setup a separate cache like Redis in the front. That would be too many moving parts. With Couchbase we got a built in cache that was managed as part of the solution, a huge plus point for us.
3. Couchbase offered a great road map, at the time we ran the evaluation N1QL wasn't GA yet, but it offered great promise and look where it has come today.
4. The official Kuberbetes operator offers a great way to run and scale Couchbase on any public or private cloud. It encompasses a lot of operational knowledge about the product and is a massive plus.
4. The cluster management for Couchbase is totally based on a REST API that is open. The standard web UI makes use of it too. The REST API offers the best way to automate administrative tasks and allows you to create your own customized monitoring arrangements.
So, above is a brief roundup of why we made an educated decision not to use MongoDB in favor of Couchbase.
2. I don't know the read/write profile of your app but based on the hundreds of apps I've helped to configure and size, I'd be inclined to suggest that you don't need a Redis cache if you're configured properly.
3. Interested in that roadmap... haven't seen it... what specifically interested you?
4. MongoDB has similar available... happy to share that with you.
You're certainly free to choose whatever solution you believe works best for your use case. However, the points you've made don't appear to provide compelling arguments for Couchbase over MongoDB.
I forgot to mention, Couchbase also guards me against the rogue DBA situation by ensuring field level encryption under application control. A huge plus.
I have had instances of data corruption in production servers with both OracleSQL and MySQL. Several sql databases take forever to fix bugs (e.g. the crappy handshake in MySQL took 5y to get fixed).
MongoDB is actually the best database I have ever used in production, in question of both performance AND scalability. So I call your bluff there, no data, no fact.
I think that points a little unfair, yes a lot of users were compromised but none of them bothered to RTFM.
When I was learning Mongo and got a link to access the database, the literal first thing I asked was well how do I secure it? Taking the time to actually learn the fundamentals of a (then) new technology is never wasted!