5 ms·
Why in the world do people choose Mongo over Postgres? I'm legit curious. Is it inexperience? Javascript developers who don't know backend or proper data modeli
by cpursley 1y ago
Why in the world do people choose Mongo over Postgres? I'm legit curious. Is it inexperience? Javascript developers who don't know backend or proper data modeling (or about jsonb)? Is this type of decision coming down from non-technical management? Are VCs telling their portfolio companies what to use so they have something to burn their funding on? It's just really confounding, especially when there's even mongo-api compatible Postgres solutions now. Perhaps I'm just not webscale and too cranky.
- a13n 1y agomaybe instead of communicating how dumb you think people are for choosing mongo, communicate why you think it’s so dumb
- cpursley 1y agoWhy mongo is dumb has been written up about ad nauseam - from data modeling and quality issues, out of control costs, etc. It's been a known toxic dumpsterfire for well over a decade...
- williamdclt 1y agoI've read a lot more about "how dumb it is to use mongo over PG" than the opposite, I think the burden of proof is on the mongo-lovers these days (not that anyone has to prove anything to randos on the internet)
- nalekberov 1y agoIMHO it's because so many people take decisions in rush. e.g. let's not design database, put whatever data shape we came ip in alpha version and see where it goes. Sometimes people favor one particular technology because every other startup chose it. To be quite honest today's software engineering sadly is mostly about addressing 'how complex can we go' rather than 'what problem are we trying to solve'.
- tgv 1y agoI'll repeat it again: you don't always want a relational database. Sometimes you need a document-oriented one. It matches quite a lot of use cases, e.g. when there aren't really interesting relations, or when the structures are very deep. That can be really annoying in SQL. > when there's even mongo-api compatible Postgres solutions With their own drawbacks.
- kdazzle 1y agoI'd probably use a jsonfield in postgres for data that i knew was going to be unstructured. meanwhile, other columns can join and have decent constraints and indexes.
- KaiserPro 1y ago> Sometimes you need a document-oriented one. Like a file system?
- tgv 11mo agoYeah, go ahead, query the file system.
- tracker1 1y agoIt depends on your use case, and RDBMS isn't the best option for all needs. Mongo's approach is pretty useable. That said, there are alternatives, you can get very similar characteristics, though a more painful devex out of say CockroachDB with (key:string, value: JSONB) tables. The only thing I really don't care for is managing Mongo... as a developer, using it is pretty joyous assuming you can get into the query mindset of how to use it. Also, if you're considering Mongo, you might also want to consider looking at Cassandra/ScyllaDB or CockroachDB as alternatives that might be a better fit for your needs that are IMO, easier to administer.
- arbol 1y agoPersonally I've found it faster to build using mongo cause you don't need to worry about schemas. You get 32mb per document and you can work out your downstream processing later, e.g. cleanup and serve to postgres, file, wherever. This data is a big data dump that's feeding ML models so relational stuff is not that important.
- debazel 1y agoI used to build personal projects like this, but after Postgres got JSONB support I haven't found any reason to not just start with Postgres. There's usually a couple of tables/columns you want a proper schema for, and having it all in Postgres to begin with makes it much easier to migrate the schemaless JSONB blobs later on.
- winrid 1y agoTheir JSONB impl is not equivalent in terms of write isolation.
- Eikon 1y agoYou definitely do have to worry about a schema. Except it’s ill defined and scattered across your business logic.
- aranw 1y ago> Why in the world do people choose Mongo over Postgres? I'm using on a project not by choice. It was chosen already when I joined the project and the more we develop the project the more I feel Postgres would be a better fit but I don't think we can change it now
- riku_iki 1y ago> Why in the world do people choose Mongo over Postgres? Postgrtes distributed story is more complicated.
- stopthe 1y agoWe've been using mongodb for the past 8 years. What we like: - schema-less: we don't have to think about DDL statements at any point. - oplog and change streams as built-in change data capture. - it's dead simple to setup a whole new cluster (replica set). - IMO you don't need a designated DBA to manage tens of replica sets. - Query language is rather low-level and that makes performance choices explicit. But I have to admit that our requirements and architecture play to the strength of mongodb. Our domain model is neatly described in a strongly typed language. And we use a sort of event sourcing.