3 ms·
MongoDB started life as a database designed for speed and ease of use over durability. That's not a good look for a database. People have told me that they ha
by jedberg 6y ago
MongoDB started life as a database designed for speed and ease of use over durability. That's not a good look for a database.
People have told me that they have since changed, but the evidence is overwhelmingly and repeatedly against them.
They seem to have been successful on marketing alone. Or people care more about speed and ease of use than durability, and my assumptions about what people want in a database are just wrong.
- Jare 6y agoReading past marketing blurbs and using products for the things they are designed is part of any engineer's job. I was irritated by MongoDB's claims and defaults, but that didn't stop us from putting it in production. We used it from 2012 to 2016 (their most infamous years?), and for our use cases, scale, size+expertise, and feature set, it was a perfect match. In our case, durability was a smaller concern by design (lots of write-only data, lots of ephemeral data), but we still configured it carefully and never ran into any data loss whatsoever; snapshots worked, migrations worked, etc. If the service had lasted longer, scaled bigger, and the business it supported had been more successful, we might have ended up with a now-classic MongoDB to pg migration. That was always an acceptable outcome, and it would have not invalidated going with Mongo at the start.
- collyw 6y ago>In our case, durability was a smaller concern by design (lots of write-only data, lots of ephemeral data), I assume that you mean write once data. If you mean write only you might as well use /dev/null.
- haimez 6y agoThe performance gains are very impressive https://tech.wayfair.com/2013/04/devnull-vs-mongodb-benchmark-bake-off/ https://tech.wayfair.com/2013/04/devnull-vs-mongodb-benchmar...
- Jare 6y agoMost backups are never actually read / used after writing but /dev/null is not a good substitute for them. [Edit] in case I wasn't clear: Imagine data that is written and rewritten and overwritten before it gets read; a user that never returns to your product - his state data was written but will never be read. That sort of thing.
- otterley 6y ago> MongoDB started life as a database designed for speed and ease of use over durability. That's not a good look for a database. I think it depends. One could say the same about Redis, but it's wildly successful and people love it. The difference is now they are advertised. Redis makes no claims to be anything other than what it is - a fast in-memory database that has some persistence capability but isn't meant to be a long-term data store. MongoDB, on the other hand, made (and continues to make) claims about being comparable in atomicity and durability to traditional SQL databases (but magically much faster!) that haven't withstood scrutiny. Keep in mind, too, that most data ain't worth much. It's one thing to entrust data of low value in MongoDB; another to store mission-critical data in it. I would look askew at leadership who didn't ask hard questions about storing data worth millions or billions of dollars in MongoDB without frequent snapshots -- and even then, the value mustn't be contingent on the 100% accuracy of said data.
- bjt 6y agoYes. What I love most about Redis is that the fundamental tradeoffs of the algorithms it's built on are surfaced up through the interface, and made very plain in the documentation.
- gav 6y agoWhen I'm thinking about data stores in large systems I like to break them down depending on how they are used on two main axes: is it fast/slow moving and durability from "we don't care" and "we must never lose data". It's easier to reason about systems if there's fewer things that require durability guarantees, ideally you want to be able to draw data flows that look like a tree instead of a graph. I find that Redis fits great because it's perfect for a whole bunch of different temporal shared state needs, everything from sessions to partial results. I've also deployed things like Ehcache, MongoDB, and Memcached to fit these needs and found other tools such as Kafka or RabbitMQ to be great "glue". Having the root of your important data be something "boring" like Postgres or MySQL (or even Oracle!) is just good risk management to me. I wouldn't want to trust Redis or MongoDB for important data because it adds to the things I have to worry about. It's "keeping your eggs in one basket" while making sure that basket is really well looked after.
- thomascgalvin 6y ago> Or people care more about speed and ease of use than durability I think 90% of the Mongo installs I've been exposed to were set up by people that were tired of fighting with Hibernate configurations and schema migrations. It's also popular among people whose definition of "legacy software" is "that app I stopped working on after three months because I have something shiny and new."
- collyw 6y agoWe have it at our work. I bet it's because it was the hip new thing to try out in 2013. Our tech lead is more into tech challenges than building a maintainable app.
- cpuguy83 6y agoI used it effectively to denormalize and combine some data from other services... sort of like a 2nd level, queryable cache. Worked very well for my needs. This was 7-8 yrs ago.
- jedberg 6y agoYes, this is true, it's good as a cache since it values speed over durability. But since it's not built for that, you could potentially do better with an in-memory database like Redis.
- collyw 6y agoMaybe it's just because I know SQL reasonably well but I don't even find Mongo particularly easy to use. Not for complex queries anyway.
- jedberg 6y agoI think the ease of use was more in the administration. It was (is?) super easy to set up and run (for small installations).
- kiwicopple 6y agoWe[1] have done 50+ conversations with developers this year (mostly indie and small startups). You’re right about the ease of use. The top reasons are - they don’t know why, it was just the one they learned/heard about first - there is a lot of tooling for it A lot of them even knew about the limitations of MongoDB but they still choose it. We concluded that other databases need to start prioritising usability; something few developer tools usually care about. [1] https//supabase.io
- pier25 6y agoSo Supabase is like Hasura for REST? When are you launching?
- kiwicopple 6y agoVery similar - our realtime is done a bit differently (we use the WAL rather than triggers), and we plan to use Postgres' RLS rather than a custom Auth system. > When are you launching? We're in alpha now - https://app.supabase.io https://app.supabase.io (desktop only)
- gwbas1c 6y agoI find with the MongoDB style of database, it's easy to prototype without needing to do the heavy schema management of SQL. But, if you need a traditional ACID database, the flexibility comes with punch in the groin technical debt.