16 ms·
Said it before, will say it again... "MongoDB is the core piece of architectural rot in every single teetering and broken data platform I've worked with." The
by im_down_w_otp 10y ago
Said it before, will say it again... "MongoDB is the core piece of architectural rot in every single teetering and broken data platform I've worked with."
The fundamental problem is that MongoDB provides almost no stable semantics to build something deterministic and reliable on top of it.
That said. It is really, really easy to use.
- eloff 10y agoAs a guy who works on ACID database internals, I'm appalled that people use MongoDB. You want a document store? Use Postgres. Why on earth would you use a database that makes so little in the way of guarantees about what results you get from it? I think most people have really low load and concurrency, so things seem to work. When things get busier you're in for a world of pain. Look I get that's it's easy to use and easy to get started with, but you're going to pay for all of that later.
- PeCaN 10y agoMongoDB: Because /dev/null doesn't support sharding.
- nameless912 10y agoBut it does support sharting. Your entire app. Into the ether.
- brianwawok 10y agoAt webscale
- leothekim 10y agoHa ha, you said "sharting."
- deleted 10y ago[deleted]
- bigiain 10y agonc -vv -l 27017 > /dev/null That and some round robin dns entries should be good enough for prod use, yeah? ('course it's not webscale ready till it's deploayble as a docker container which contains critical nodejs code with a dependancy on leftpad.js...)
- Thaxll 10y agoBecause Postgres doesn't have any clustering / HA features. So out of the box it doesn't scale well.
- chaostheory 10y agoIf you want that you can always use a variant of postgres that does like greenplum, citus, and a few others. They're battle proven. There's also MySQL and its variants as well. Not to mention that are NoSQL alternatives that have a better track record than Mongo like Cassandra.
- hinkley 10y agoAre there NoSQL alternatives that have a worse track record than Mongo?
- chaostheory 10y agoThere probably are, but they just don't enjoy the same level of popularity as Mongo or they'd be scrutinized just as much.
- threeseed 10y agoCassandra, HBase etc had checkered pasts with plenty of their own data loss and inconsistency bugs. Now they are considered two of the most rock solid NoSQL databases. The hatred towards MongoDB really is pretty irrational given just how popular the database is.
- deleted 10y ago[deleted]
- chaostheory 10y agoIt is anything but irrational. https://aphyr.com/posts/322-jepsen-mongodb-stale-reads https://aphyr.com/posts/322-jepsen-mongodb-stale-reads If it isn't already fixed, they need to fix it. I can't vouch for HBase, but Cassandra is stable and reliable now. Cassandra is also easier to scale.
- Mandatum 10y agoI was always a big fan of calling MongoDB the "Snapchat for databases". I think people even had some stickers printed for it..
- Normal_gaussian 10y agoHey! Snapchat is pretty useful for seeing snapshots into the not completely dull parts of my friends lives. It has its potential flaws in being able to save the images/videos but please don't do it the disservice of likening it to MongoDB.
- Mandatum 10y agoOops - corrected, I meant "Snapchat for Databases" rather than "the Snapchat of Databases". Also, semi-OT: your reply was hilarious.
- toomuchtodo 10y agohttps://pbs.twimg.com/media/CWhO2jIUYAAbuiK.png https://pbs.twimg.com/media/CWhO2jIUYAAbuiK.png
- vonklaus 10y agoWhat do you think about noSQL in general. From what I could follow from aphyr rethinkdb seems pretty awesome. I like it a lot, but I am also not getting a ton of traffic on localhost:3000...
- LionessLover 10y ago> What do you think about noSQL in general. That is an unanswerable question since it's about everything. "NoSQL" is a huge variety of techniques - many of them yet to be invented, that only have one thing in common: "not SQL". From document storage over key/value storage to graph databases. Anyone who tells you what they think "about NoSQL" either has to redirect the question to become a useful one, or if they actually attempt to answer it take your popcorn and expect entertainment at best. "Types and examples of NoSQL databases" - https://en.wikipedia.org/wiki/NoSQL#Types_and_examples_of_NoSQL_databases https://en.wikipedia.org/wiki/NoSQL#Types_and_examples_of_No...
- vonklaus 10y agofair enough. I mentioned rethinkdb above because I find it very intuitive and versatile. I've used mongodb a fair bit but I like rethinkdb better for a host of reasons. I guess what I meant was, I thought mongodb was ok however everyone here seems to have always known it was deeply flawed. I tried to follow the jepsen report on rethink but I don't fully comprehend the tradeoffs/benchmarks ect, and was curious what others thought about it.
- tomphoolery 10y agoPostgres wasn't always a great document store...there was definitely a time period where if you wanted to take a document-oriented approach to data modeling, MongoDB was a good way to go. JSONB was only added in the last minor version of Postgres, and while the JSON and HSTORE types were available, it didn't give you quite the same speed. Now that JSONB is a thing, I think the two databases are more comparable as a document store.
- im_down_w_otp 10y agoIs that actually true? I mean the part about Postgres might be, I don't know. But was there a time when MongoDB was a good way to go? Was there ever a time when it actually worked consistently well at something that was database shaped? Because I started dealing with it in ~2010 I think, and it wasn't a suitable database for anything other than toy projects or throw-away data back then, and while it's many versions newer, it still appears to be pretty fast and loose with its supposed system guarantees. There was a point when they raised $100+ Million in funding that I thought they'd take that money and actually build a database. At least as recently as last Summer that wasn't a reality yet.
- Lazare 10y ago> But was there a time when MongoDB was a good way to go? Not in any way, shape, or form. Keep in mind, as bad as it is now, it was vastly worse when it launched.
- themartorana 10y agoA text/blob field with a normalized key column or two were always vastly superior. We're talking about data loss at an incredible level. I mean, a new Jepsen test comes out and this community goes bonkers over how database X might suffer a split-brain problem for a few milliseconds under an extreme condition but Mongo on a single instance has never been safe, and people are making excuses for it.
- sciurus 10y agoSomewhat surprisingly, recently Aphyr came close to recommending MongoDB. From https://aphyr.com/posts/329-jepsen-rethinkdb-2-1-5 https://aphyr.com/posts/329-jepsen-rethinkdb-2-1-5 : > I’ve hesitated to recommend RethinkDB in the past because prior to 2.1, an operator had to intervene to handle network or node failures. However, 2.1’s automatic failover converges reasonably quickly, and its claimed safety invariants appear to hold under partitions. I’m comfortable recommending it for users seeking a schema-less document store where inter-document consistency isn’t required. Users might also consider MongoDB, which recently introduced options for stronger read consistency similar to Rethink–the two also offer similar availability properties and data models.
- spriggan3 10y ago> Why on earth would you use a database that makes so little in the way of guarantees about what results you get from it? Because some people can't stand having to work with SQL,migrations,schema and constraints, it's as simple as that ( That's not my opinion,that's just the rational behind MongoDB). Even if you use Postgres with the Json column type, you still need to write SQL queries and schemas. In the context of analytics, it might make sense, I'm not a big data analyst, but I've seen MongoDB used to centralize logs.
- toomuchtodo 10y agoWho knew you'd need to learn how to use tools to use them!
- deleted 10y ago[deleted]
- blitzkriegpunk 10y agoGet. Out. Of. Town.
- im_down_w_otp 10y agoIs having seen something used some way a leading indicator of it being a good idea to have used that thing that way? Because I've seen Excel used as database with all kinds of macros and VBA scripts bolted-on/embedded to provide the workbook various shapes of stored-procedure and query capability... but, while sorta impressive in a "Holy crap, lol wut?" kind of way, I'm not sure any instance I observed of uses like that were actually good ideas. Full of epic cleverness and ingenuity? Definitely. A good idea? Probably not.
- jdavis703 10y agoDid they make the company a lot more money than they cost? If so they were probably a good idea. Not all code needs to be "pretty" to serve a purpose. I've seen some pretty epic hacks that I know generated hundreds of thousands of dollars of new revenue.
- Pxtl 10y agoBecause postgres doesn't focus on the first-five-minutes experience the way Mongo does. Even the name is hard to say. Mongo is a dumb, dead-end platform, but they know how important ease-of-use is.
- catnaroek 10y ago> Mongo is a dumb, dead-end platform, but they know how important ease-of-use is. By “ease of use”, do you mean “ease of making something that seems to work” or “ease of making something that actually works”? I've never used a schema-free database, and ended up thinking to myself “I'm completely sure this database can't possibly contain garbage data”. Or do programmers simply not care about data integrity anymore?
- themartorana 10y agoPrototyping on Mongo is bad. MySQL takes 10 seconds to install. I'm imagining with the public Docker registry, so does Postgres. How many times have you promised to fix something later and then later comes and... Prototyping is not an excuse for laziness. It does feel like some programmers don't care.
- Pxtl 10y agoYou can insult the developers that use Mongo or you can look at how to get those users onto a better platform. With the modern expectations of full-stack development, is it any wonder that something promising simplicity and zero-configuration data storage does well?
- xapata 10y ago> MySQL Why not just prototype with Sqlite? You don't even need a server.
- StavrosK 10y agoThe single biggest source of grief in our production database has been the one JSON field we used once to avoid adding another table. That goddamn thing has crashed the server so many times with invalid data, that I'm never using anything schemaless again. We recently migrated to a proper table and I'm thanking my lucky stars I finally got rid of that devil.
- guelo 10y agoBut if you need to scale horizontally use Rethinkdb or Cassandra.
- chx 10y agoThis will be highly subjective but you need to get over the "postgresql has the longest feature list so why don't you use it". The last startup I have been involved with tried to use PostgreSQL and needed to move to MySQL (yeah, well) because commercial support was both more expensive and less useful than what we were able to get for MySQL. Perhaps today it's different. While I no longer use PostgreSQL much, every time I need to touch it seems rather developer unfriendly, just last month I found MySQL, heck even SQLite supports triggers with code inlined into the trigger body but PostgreSQL mandates writing a separate function for the trigger. And, of course, it needs to be in plpgsql because reasons. The most trivial "let's calculate another column" becomes a complicated nightmare. So then if you don't want to use PostgreSQL what then? The answer now is MySQL, again, because 5.7 has JSON. And mind you, I have grown to dislike MongoDB slowly over the years as new types of queries have appeared and it's a complete mess by now. There was an excellent article on this posted on Linkedin of all places this March https://www.linkedin.com/pulse/mongodb-frankenstein-monster-nosql-databases-john-de-goes https://www.linkedin.com/pulse/mongodb-frankenstein-monster-... It's really interesting how MySQL is the most usable and most supported database by now...
- brandur 10y ago> This will be highly subjective but you need to get over the "postgresql has the longest feature list so why don't you use it". I think if you re-read it, you might see that at no point did the post that you're replying to imply that Postgres was preferred because it had a longer list of features. They're speaking entirely about the strong guarantees that an ACID system gets you. Document stores are only mentioned because this is one of the (incorrectly) perceived advantages that Mongo has over Postgres and other databases.
- jeffdavis 10y ago"just last month I found MySQL, heck even SQLite supports triggers with code inlined into the trigger body but PostgreSQL mandates writing a separate function for the trigger" The right response, as a postgres developer, is to agree that you describe a useful feature, and perhaps implement it to help other users. But my advice to you is to be willing to put up with some short-term annoyances. Sometimes the best choices are a little annoying, and if you refuse to consider them, it will cost you (or your employer) much more later.
- hitr 10y agoA startup which I have helped architect back end uses mongodb for everything. before starting the project I have requested the CTO not to use mongo as it was not a right fit.Basically they needed more of a relational stuff.The CTO chose mongo because he was thinking every startup uses it and why not us. Now they are suffering as they need ACID and relational features. They want to rewrite to postgres but they are heavily invested and not easy to go back.
- chris_wot 10y agoSounds like a startup with a very short timeframe.
- SmirkingRevenge 10y agoOr if you want a rock solid json document-based db with an awesomely killer api - use RethinkDb. Its a phenomenal product.
- Kiro 10y ago> Look I get that's it's easy to use and easy to get started with Yes, and that's why I'm using it. > but you're going to pay for all of that later. [...] When things get busier you're in for a world of pain. Will never happen.
- cpplinuxdude 10y agoWhy on earth haven't I come across this information before? I spent a crazy amount of time researching frameworks before settling for Meteor, and never came across this.
- vidarh 10y agoHere's one: You're dealing with a torrent of incoming semi-unstructured data, where losing a good chunk of it is minor nuisance because you only need a decent sample, from which you extract data. In those kind of scenarios, making it easy to work on the code can often be far more important than reliability. I have a project like that now. I'd love to use Postgres, and probably will eventually once things "settle down" and we know what data we need to store. But or now MongoDB is the "quick and dirty" solution. We define a schema client side for everything we nail down, so as we nail down more aspects of what data to process, it gets easier to transition to a proper database. As ORMs get better support for Postgres' JSON capabilities, it will likely get less and less appealing to use MongoDB for stuff like this too.
- draw_down 10y agoAll I ever hear is terrible things about it. I'm not a "gotta hear both sides" kind of person so that means something to me.
- collyw 10y agoI (used to) hear lots of good stuff, but the type of devs were always hype driven. Asking for a reason why Mongo was used, the reply sounded just like the marketing hype on Mongo's homepage - lots of buzzwords and catchphrases ("big data", "schemaless") with no substance to the reason for choosing it.
- joeblau 10y agoI worked at a Data Analytics start up in Palo Alto back in 2011 and we had 8 or 9 databases in our arsenal for storing different types of data. MongoDB was by far the worst and most unstable database we had. It was so bad that for the presidential debate, I had to stay up and flip servers all night because even though the shards were perfectly distributed, the database would crash and fail over to two other machines which couldn't handle our entire social media stream. We ended up calling some guys from MongoDB in to help us troubleshoot the issue and the guy basically said "Yeah we know that's a limitation; you should probably buy more machines to distribute the load." I like the concept of Mongo, but there are other more robust NoSQL databases to choose from.
- ajmurmann 10y agoI had a similar experience in 2011 with Mango where we were running map reduce jobs which Mongo advertised to support. The whole system got blocked from running the map reduce and the Tengen consultant sighed when we told him we were running map reduce jobs.
- LionessLover 10y agoWhich isn't the best argument to make against MongoDB since you should have known - it's even part of their course curriculum - that map/reduce is not the optimal way to aggregate in MongoDB. They have their own aggregation framework (https://docs.mongodb.com/manual/core/aggregation-pipeline/ https://docs.mongodb.com/manual/core/aggregation-pipeline/). I have no intention of defending MongoDB because what do I know, never worked with it in real life - but just out of curiosity I took the free courses they offer (https://university.mongodb.com/ https://university.mongodb.com/) and I find that a sizable share of the complaints about MongoDB come from people who don't seem to have learned much about the product they are using. It's like people complaining their new truck behaves badly in water. A lot of critics seem to have chosen MongoDB when they needed a SQL DB from day one. If you need full flexibility to (re)combine data you need SQL, for example. A document store isn't "schema-less" at all - much of the schema is built-in and very inflexible after that.
- JustSomeNobody 10y agoI remember during peak mongo that if you weren't working on a project that used mongo, other devs looked down their noses at you.
- im_down_w_otp 10y agoBut that was only because they had to stand on their tippy-toes and tilt their heads back to avoid drowning in PagerDuty alerts. ;-)
- partycoder 10y agoNot to mention that many MongoDB drivers are worse than MongoDB itself, adding insult to an already unprovoked vicious injury. The official Java driver is the easiest way to waste otherwise useful CPU time due to its blocking nature and wasteful threading model.
- zeemonkee3 10y agoNodeJS + MongoDB is this generation's Laurel and Hardy stack ("look at this mess you got me into"). Last generation's was PHP + MySQL.
- justinhj 10y agoActually PHP and MySQL is a pretty respectable stack today if you use it right.
- tremon 10y agoThat's because we've learned to avoid most of the pitfalls of the tools.
- KMag 10y agoI actually wonder what the correlation is between PHP use and MongoDB use. They both have an attitude that mistakes ease with simplicity, a philosophy that puts correctness way down the priority list, and an easy introduction with a heavy ongoing maintenance tax.
- badthingfactory 10y agoIt's pretty easy to use... until you have to normalize data and query across one or two joins. I've been forced to build with mongo for the past few months (still not sure why) and I can't think of a single valid use-case for this rubbish. If you need denormalized/distributed caching, Redis does a good job. If you need to store some unstructured json blobs, postgres and now sql server 2016 can do that. If you need reliable syncing for offline capable apps, you probably want CouchDB. If you need real time, use Rethink Obviously, relational data belongs in a relational database. I think the problem is that all of these databases do one or two things really well. Mongo tries to do all of these things, and does so very poorly.
- Idontreddit 10y agoYes it is easy to use. But too bad it also fails "transactions" silently so that you don't even know if your changes were "committed" or not. Don't worry, it only happens every once it a while so it's not a big deal... Unless you are coinbase or an organization that deals with money/bitcoins/etc and you need ACID compliant transactions so that "debits/credits" don't just magically disappear. When the bitcoin craze was going crazy, coinbase had all kinds of problems due to their mongodb backend.