5 ms·
MongoDB takes a swing at PostgreSQL after claiming wins against rival
- bionhoward 2y agoAll I know is, I’m using PostgreSQL and enjoying it!
- 0xDEADFED5 2y agoRedis is fast too, but I don't go around comparing it to a proper database =/
- petcat 2y ago/dev/null scales better than all of them
- modderation 2y agoBut is it web-scale?
- erik_seaberg 2y ago"Mongo DB Is Web Scale" is pretty entertaining: https://www.youtube.com/watch?v=b2F-DItXtZs https://www.youtube.com/watch?v=b2F-DItXtZs (https://news.ycombinator.com/item?id=1636198 https://news.ycombinator.com/item?id=1636198 linked to the original platform, which sadly shut down after a few years.)
- shoo 2y ago/dev/null : the optimal solution for write-only workloads
- magicalhippo 2y agoIt's eventually consistent as well, so same guarantees as MongoDB in that regard.
- CaptainZapp 2y agoAnd it massively improves backup times (let alone, restores)
- benwilber0 2y agoI had such a bad experience with Mongo DB back in 2012-2013 that I don't think I'll ever use it again, or even really consider it. But maybe it's changed and gotten better since then? Anyway. I just use Postgres.
- petcat 2y ago> Anyway. I just use Postgres. Same. Because I care about my data.
- PaulHoule 2y agoIf you like the document db idea there are a lot of choices, especially https://arangodb.com/ https://arangodb.com/ which I think gets little attention because people who use it see it as a secret weapon. Too bad about the license though. Also https://couchdb.apache.org/ https://couchdb.apache.org/ and https://developer.marklogic.com/ https://developer.marklogic.com/
- wslh 2y agoIsn't PostgreSQL supporting JSON and queries over them? [1] [1] https://www.reddit.com/r/django/comments/14f68rz/postgresql_json_vs_mongodb/ https://www.reddit.com/r/django/comments/14f68rz/postgresql_...
- PaulHoule 2y agoIt does. See https://www.postgresql.org/docs/current/datatype-json.html https://www.postgresql.org/docs/current/datatype-json.html I think it is ugly as hell to work w/ json documents in pgsql but most of the eng managers I’ve known think you couldn’t get fired for choosing pgsql.
- dgacmu 2y agoIt's ugly but having a field that's just a dictionary is really handy and not too ugly. We use a lot of them for things like "tags" (which can take freeform user- or ml- supplied image tags in key:value format). I adore it. (We tried mongo with one of our annotation systems and regretted it.) It's a very nice way to balance quick development (you don't need a schema change to try a feature for a while) with the benefits of a mostly schema-defined db.
- late2part 2y agoI heard MongoDB is webscale, yeah?
- Banditoz 2y agohttps://www.youtube.com/watch?v=b2F-DItXtZs https://www.youtube.com/watch?v=b2F-DItXtZs
- lpapez 2y agoI was there in 2010s migrating Mongo databases chosen by "expert consultants" to Postgres and dealing with the fallout of massive tech debt those decisions usually caused. Won't get fooled again - no matter how many fluff articles they write you will sooner find me rotting in this barren earth than see me pick MongoDB for a new project.
- flashgordon 2y agoJust checking you said migrating mongo to postgres. Did you mean the other way around? I still don't understand how mongo is still in business.
- hinkley 2y agoAre any of you guys old enough to remember when Marc Fleury got caught in an astroturfing scheme involving JBoss employees? That’s actually how I learned that word had been coined. The MongoDB Team didn’t do exactly the same, or at least nobody caught them, but they did have a massive hype cycle, selling snake oil full of serious concurrency bugs. Managed to time their funding right so they ended up with enough money to buy a completely different NoSQL implementation, that actually did work (mostly), discontinued work on their code and relabeled the other implementation as Mongo. I don’t patronize companies built on a bed of lies. Because how do you trust the lies stopped? They have a proven track record of being good at it. And you’re rewarding all of that behavior. The ends justify the means? Fuck that.
- evantbyrne 2y agoI suspect a good amount of the hype around NoSQL was driven by frontend developers transitioning into backend work via Node, and Mongo being relatively simple to get started on compared to relational databases. And that culture seems to have stuck. To this day, many popular backend js frameworks either completely ignore relational data storage or slap some bare bones interface over it.
- petcat 2y ago
- sv123 2y agoI loathe so much getting data out of mongo in a reasonable fashion. Pipelines are a nightmare to accomplish what you can do in 10 seconds writing sql.
- thot_experiment 2y agoGranted I really don't spend my time evaluating databases rigorously, but I find claims that MongoDB is more performant than Postgres really difficult to believe. It sounds like a skill issue to me. MongoDB is technical debt, it has it's place for when you don't know what you're doing and you just need to throw your data somewhere. Eventually you're going to grow to a point where the overhead of not using real data structures is going to cease to be worth it. (I realize this is directly contrary to what's stated in the article, but who are you gonna believe, MongoDB or a random HN commenter? :)
- a57721 2y agoThe quotes from the CEO are misleading, implying MongoDB is document-based and PostgreSQL is 100% relational. This is not true, PostgreSQL has had JSON support for quite some time.
- petcat 2y agojson/jsonb, hstore, ltree, btree/gin/gist, enum types, nested record types... the list goes on and on. PG is _very_ hard to beat. Mongodb certainly isn't doing it. Their entire value proposition boils down to create table docs ( doc jsonb );
- nyrikki 2y agoDocument-oriented databases are a subclass of the key-value store. Postgres jason types are blobs in an RDBMS, and jsonb is to be avoided in almost all cases. I am not a MongoDB cheerleader and I am a huge fan of Postgres when SQL is appropriate, but equating an ACID style DB with a key value store misses the point. But it is horses for courses, people using MongoDB for acid transactions when support landed in v4 is where most of the problems came from. When deployed in their core domains, both work better than the hacks implemented to artificially make them competitors.
- petcat 2y ago> Postgres jason types are blobs in an RDBMS, and jsonb is to be avoided in almost all cases. You might be uniformed (or misinformed) on this topic. JSONB is not just a "blob" in Postgres. It's a first-class value type with full query-ability and indexing support. [0] https://www.postgresql.org/docs/current/functions-json.html https://www.postgresql.org/docs/current/functions-json.html
- nyrikki 2y agoFighting with autocorrect, 'json' type is a blob with a path search in front. https://www.postgresql.org/docs/current/datatype-json.html https://www.postgresql.org/docs/current/datatype-json.html > JSON data is subject to the same concurrency-control considerations as any other data type when stored in a table. Although storing large documents is practicable, keep in mind that any update acquires a row-level lock on the whole row. Concurrency is far more nuanced in MongoDB and storage of documents has far fewer side effects than jsonb. The ad hominem is ironic with someone claiming RDBMS and key value stores are equivalent.
- codr7 2y agoI consider MongoDB a huge warning sign; if you think that's a good idea I don't want anything to do with your code.
- nahnahno 2y agoMongo is hated here but I’ve made many services with Postgres and mongo is just far easier to use. Json tooling in Postgres is not as good. I don’t particularly hate or like any one database, but thinking about migrating the workloads that I have in mongo to Postgres just gives me no interest. Mongo solves the problems I have very well.
- jdyer9 2y agoThat's the thing about Mongo, it's great until it's not. And Not comes quickly for many projects. There's probably tons of small Mongo installations all over the internet doing great in their little niche. But the moment a project gets too big for Mongo, it becomes a problem very quickly. I suppose it's like comparing a bike to a car. If your problem is getting around a small town with nice weather, the bike wins. But the moment you need to move 5 people on the interstate to the next town in bad weather, there's no real choice besides the car. That's been my experience with mongo every time
- prmoustache 2y agoUsing a gambling company as an example for a win in the IT space sounds to me as if UPS was bragging about winning a contract with a drug cartel to import fentanyl and crystal meth. Weird choice. Doesn't give you much faith they have a lot of examples of companies migrating from Postgres.
- FLT8 2y agoThe main trouble I have with mongo or document databases in general is that using them effectively requires a lot of design thinking up front. You need to really understand your domain model, in a DDD sense. This isn't usually made clear to people. Document databases are good for working with / storing aggregate root objects and related entities. If you don't know what that means, or are feeling your way through a new domain and aren't in a position to decide if you're really dealing with an aggregate root object or not, or think things might be subject to change later, put the tools down and go with something more conventional. Additionally, if you do use mongo for your operational data store, you should probably consider combining it with read-projections in a relational style DB too, or at least more conventionally defined flattened collections in mongo, in order to service bulk read style queries. Aggregation queries in mongo can get out of control quickly if you're not careful. Much better to plan for that early. And if you end up separating concerns like that, you'll probably find yourself wondering why you didn't just go with Postgres from the start.
- DemocracyFTW2 2y agoIn the 2010s when the MongoDB craze was in full swing I took several deeper looks at MongoDB but all that I was left with was befuddlement—why? why would I choose Mongo over a real database? It never made any sense.
- computerfan494 2y agoI have deployed Postgres and MongoDB at petabyte scale. I am happy to answer questions from others who are intellectually curious about differences between the two that would matter to users who have to spend serious amounts of money on their databases.
- asah 2y agovanilla, single-node postgres ?
- computerfan494 2y agoNo, it's frankly not possible to deploy Postgres at scale without a third party (or hand-rolled) HA/scaling solution. I worked on an application that hand-rolled one after considering several products.
- DemocracyFTW2 2y agoFor people who don't want to take form participants in this thread, maybe you should consider listening to no other than Mike Stonebraker[1]: NoSQL databases that store data as JSON documents, such as MongoDB and Couchbase, benefited from developer excitement over a denormalized data structures, a lower-level API, and horizontal scalability at the cost of ACID transactions. However, document stores “are on a collision course with RDBMSs,” the authors write, as they have adopted SQL and relational databases have added horizontal scalability and JSON support. “Another wave of developers will claim that SQL and the RM are insufficient for emerging application domains,” they write. “People will then propose new query languages and data models to overcome these problems. There is tremendous value in exploring new ideas and concepts for DBMSs (it is where we get new features for SQL). The database research community and marketplace are more robust because of it. However, we do not expect these new data models to supplant the RM.” [1] https://www.datanami.com/2024/07/08/dont-believe-the-big-database-hype-stonebraker-warns/ https://www.datanami.com/2024/07/08/dont-believe-the-big-dat... discussion: https://news.ycombinator.com/item?id=41406420 https://news.ycombinator.com/item?id=41406420
- rich_stable 2y agoMongoDB gets a lot of hate and created a bad reputation for itself by way of a very successful marketing campaign where they convinced a whole lot of companies to replace whatever RDS they were using with MongoDB some years ago. This caused a lot of RDS-driven applications to uh, experience a lot of development issues. It basically never makes sense to drive an application with MongoDB, which is why a lot of folks think it's strictly worse. A perfect MongoDB (or any document db, really) use case has zero relationships. This is accomplished by duplicating data across documents where you would normally use a foreign key in an RDS. Naturally, this is anti-pattern for RDS-minded folks and everything you'd want to do with Mongo stems from this mode of thought (preprocessing/data replication instead of lookups). Personally, I've had great success with Mongo and appreciate it for it's incredible depth in text searching via Atlas Search. Surprisingly, the web interface for Atlas in general is actually quite good and it's the only one I can bear to use; I usually can't stand them.