Live data from Hacker News

The Great Migration from MongoDB to PostgreSQL

infisical.com

321–330 of 339 posts

Re: The Great Migration from MongoDB to PostgreSQL

#321

Earlier quoted context omitted.

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.

Ouch? Are there standard tools to monitor that? Any best practice to avoid? I am considering exactly tha kind of setup...

Re: The Great Migration from MongoDB to PostgreSQL

#322

General speaking: don't use mongodb. It was super shitty when it came out and using postgres gives you a better and faster solution which you can also use in other projects. I'm always impressed when I see mongodb still making money.

While I'd agree with the general stance of avoiding MongoDB for any new project, I find the statement that postgres always gives better and faster solution dubious. They don't really solve the same problems. If you happen to really need horizontal scaling, actual HA (not failovers) or documents with many field-level atomic operations, MongoDB might still be a better fit than postgres. For on-premise hosting, not having any HA out-of-the-box can be a major painpoint.

Re: The Great Migration from MongoDB to PostgreSQL

#323

Earlier quoted context omitted.

Because vertical scaling can take you so far these days that 99% of companies will never, ever reach the scale where they need more. There is just few incentives. Especially since: - Servers will keep getting better and cheaper with time. - Data is not only in postgres, you probably have redis, clickhouse and others, so the charge is balanced. In fact you may have different dedicated postgres, like one for GIS tasks.…

> vertical scaling can take you so far these days that 99% of companies will never, ever reach the scale where they need more its less about the scale and more about HA and service interruption: your service will be down if server dies.

Never heard of docker/k8s?

Re: The Great Migration from MongoDB to PostgreSQL

#324

Earlier quoted context omitted.

> vertical scaling can take you so far these days that 99% of companies will never, ever reach the scale where they need more its less about the scale and more about HA and service interruption: your service will be down if server dies.

Never heard of docker/k8s?

I don't think these two words will buy you HA automagically. You will need 3 layers of various open source components on top, and I am not sure if they will improve or reduce HA at the end.

Re: The Great Migration from MongoDB to PostgreSQL

#325

General speaking: don't use mongodb. It was super shitty when it came out and using postgres gives you a better and faster solution which you can also use in other projects. I'm always impressed when I see mongodb still making money.

While I'd agree with the general stance of avoiding MongoDB for any new project, I find the statement that postgres always gives better and faster solution dubious. They don't really solve the same problems. If you happen to really need horizontal scaling, actual HA (not failovers) or documents with many field-level atomic operations, MongoDB might still be a better fit than postgres. For on-premise hosting, not havi…

Sharding does exist with postgres.

What type of ha can mongo do postgres can't?

Re: The Great Migration from MongoDB to PostgreSQL

#326
post #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.

Why did you move from RethinkDB to Postgres? I've very little experience with Rethink and have only played around with it a few years ago with some small project but found it to be really interesting. I'm just curious about what issues you experienced with it.

Re: The Great Migration from MongoDB to PostgreSQL

#327

Earlier quoted context omitted.

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.

Ouch? Are there standard tools to monitor that? Any best practice to avoid? I am considering exactly tha kind of setup...

I don't know about there being a standard tool but you can track the LSNs together with a timestamp on the write node and from there calculate the replica lag by checking what LSN the replica is at

Re: The Great Migration from MongoDB to PostgreSQL

#328
post #298

Earlier quoted context omitted.

MongoDB is great if what you need is a replicated log or queue. It's what Kafka should have been.

As others have said, you can just use your RDBMS for that now. Mongo is a feature of better products.

Postgres doesn't have a sane and working replication story. (Mysql does, but it's full of legacy warts, of course.)

Mongodb is foolproof and works out of the box.

The other alternative here isn't Mongodb, it's Couchdb, but that isn't an RDBMS.

Re: The Great Migration from MongoDB to PostgreSQL

#329
post #297

Earlier quoted context omitted.

I'm actually very bullish on MongoDB. While the article and significant sentiment in threads suggest a push off MongoDB toward PostgreSQL, I do think MongoDB has its own place in the stack and that it won't be obsoleted. I've personally had many pleasant experiences working with it in past projects. Regarding business metrics, I may have a slight bias coming from the startup world but we often value revenue the most,…

HN should be full of Mongo's users and advocates, and yet this site loathes it. That by itself is a sign that it's a zombie. The reason we don't just look at revenue is that you can "buy" revenue with ads and sales teams. But if that revenue growth costs more than it pays because your customers aren't sticky, then your business doesn't work. You can't apply startup principles to this large, aging public company.

“This site” loved ReThinkDB. How is it doing?

Re: The Great Migration from MongoDB to PostgreSQL

#330

I use MySQL for everything - always have. Can someone hit me with a few reasons why you would use Postgres over MySQL? I don’t have any familial affinity to any database, but I’m not sure what the benefits to Postgres are relative to MySQL.

Stability, reliability, consistency. If you do anything with Unicode you're also much better in PostgreSQL. Faster indexes, smaller base install ( ), and much more complete SQL language support. ( ) note: when PHP was taking off, MySQL had a smaller install base. This has long since changed - PostgreSQL hasn't grown much over the years, and MySQL has, at least since the last time I worked on both circa 2015-ish.

Friendly nitpick, because I had a double-take when reading the second paragraph: Be careful to differentiate between "install base" and "base install". In both cases, you are referring to "installed size of the database in its base configuration". But "install base" commonly means "number of installations". So I was very confused when the second paragraph was implying (using the standard meaning for "install base") that the number of Postgres installations had not grown over the years.
Post reply on HN