Live data from Hacker News

The Great Migration from MongoDB to PostgreSQL

infisical.com

41–50 of 339 posts

Re: The Great Migration from MongoDB to PostgreSQL

#41

Ah, the old "I used a wrong product for my problem and now I complain the product is bad because it does not suit my case." defence. MongoDB is a document database. It is not supposed to be good at relations. Also lacking support with cloud providers and lacking experience with MongoDB is not MongoDB's problem, it is your poor decisionmaking. If you value those things, you should have taken it into account when you w…

To be fair, Mongodb’s pr team did their best to present it as the solution to all problems.

> In 2012, 10gen’s VP of Corporate Strategy Matt Asay argued “there will remain a relatively small sphere of applications unsuitable for MongoDB … the majority of application software that developers write will be in use cases that are better fits for MongoDB and other NoSQL technology … Those functions that really help a company innovate and grow revenue [will be NoSQL].” He would note that we were living in the post-transactional future.

https://news.ycombinator.com/item?id=15124306

Re: The Great Migration from MongoDB to PostgreSQL

#43
Funnily enough, the one feature I don't recommend in Postgres is Cascade. Unless you have a very small controlled set of FK it's not a good idea. Batch delete is less problematic. I wish Postgres would do something about it, like elasticsearch deleteByQuery that can run in the background.

Re: The Great Migration from MongoDB to PostgreSQL

#44
Take away is this has less to do with technical reasons and most to do with licensing, which is fair.

The other takeaway is the fact that they saw huge gains switching as a result of query optimizations with joins shows that they’re data wasn’t properly modeled for use with a key value store, which probably added to them switching to the right type of store to begin with.

Re: The Great Migration from MongoDB to PostgreSQL

#45
I have done this migration twice and rethinkdb to PostgreSQL once. At this point I think document DBs are as good as dead for new projects. They will live for a really long time still but are in contraction and rent seeking mode now. Expect MongoDB licensing and hosting to increase in price and languish in terms of feature development from here on out.

Re: The Great Migration from MongoDB to PostgreSQL

#46
post #17

Earlier quoted context omitted.

How are JSON operations not atomic? Genuinely curious

I think the sense is not "atomic by field" or whatever you'd call that. If you're going to ignore the fact that PG is an actual ORDB and just store gigantic blobs of JSON in it, it will write the entire object whenever you update part of it, because the whole point is you're supposed to store it as a multi-field record.

Isn't that true for Mongo as well?

Re: The Great Migration from MongoDB to PostgreSQL

#47
post #31

Earlier quoted context omitted.

Postgres is no hype, it was already in plateau of productivity when MongoDB came to the web scale scene. Hadoop just like Mongo had their hyped time in the sun, but RDBMS are far too advanced and versatile than any of them were.

I am not calling Postgres hype - it should have never been NOT hype. It's a reasonable default for most problems, Now all I read about is how Postgres is awesome, as if it's this great new thing. I guess that makes sense, as the new generation of engineers is rediscovering stable, reliable, lean technologies after a decade of excesses with "exotic" tech. For grey beards, it's all very odd. Like, "where have you all b…

...and, continuing the cycle next season, devs will (re)discover NoSQL and document DBMS. I do wonder if this phenomenon of trendy tech is somehow integral to advancing the state of the industry, the SWE equivalent of early adopters. "Rediscovering the old" is a side effect, as old tech is used and reinterpreted in new ways. Kind of neat, really.

Re: The Great Migration from MongoDB to PostgreSQL

#48
Some years ago we had so much problems with MongoDB that we also ditched it for Postgres. Never been happier.

Not the reason, but very annoying: Why doesn't (perhaps this has changed?) MongoDB use SQL but Javascript with endless $s? It was always a pain writing ad-hoc queries.

Re: The Great Migration from MongoDB to PostgreSQL

#49
post #21

is it still difficult to create a cluster of pg dbs. either for redundancy or speed ? Last time i advocated for using pg vs mongodb, the person replied that mongodb clustering was super easy.

Read replicas are pretty easy on postgres using replication. That said, you need to be careful about replica lag. If you want to distribute your writes, that's a little trickier. There are options like Citus and such. But still not natively supported.

Second that. A client hat PG replica lag, was doing backups from the replica and found out during restoring a backup, that some hours of data were missing.

Re: The Great Migration from MongoDB to PostgreSQL

#50
post #31

Earlier quoted context omitted.

Postgres is no hype, it was already in plateau of productivity when MongoDB came to the web scale scene. Hadoop just like Mongo had their hyped time in the sun, but RDBMS are far too advanced and versatile than any of them were.

I am not calling Postgres hype - it should have never been NOT hype. It's a reasonable default for most problems, Now all I read about is how Postgres is awesome, as if it's this great new thing. I guess that makes sense, as the new generation of engineers is rediscovering stable, reliable, lean technologies after a decade of excesses with "exotic" tech. For grey beards, it's all very odd. Like, "where have you all b…

I remember Robert C. Martin ("Uncle Bob") going on about how No-SQL will replace literally all SQL and that there is literally not a single use case for relational data and SQL. I wonder if he ever came back on that.

Now, my opinion of Martin in general is not especially high and he's a bit of a controversial figure, but it wasn't just the kids. And Martin is also all about reliable software, so that makes it even more surprising.

Post reply on HN