Live data from Hacker News

Ask HN: Is PostgreSQL better than MySQL?

news.ycombinator.com

31–40 of 83 posts

Re: Ask HN: Is PostgreSQL better than MySQL?

#31
Having managed both in production at decent scale for years, I would not choose MySQL for any projects going forward. Postgres has been more dependable in its performance, more powerful in its features. There’s no “pro” to choosing MySQL that I’m aware of in 2023.

Re: Ask HN: Is PostgreSQL better than MySQL?

#32
Started with MySQL in the mid 2000s. It was ok for what I needed. Then switched to Postgres early 2010s. Found it richer in tooling, extensions, and options. I don't know how well MySQL supports them today, but here are just a few features that I've found compelling in postgres, while using it in various projects: JSON, search, schema, PLs, roles. The list of what postgres can do seems endless. I was once hired to contribute on a Python/postgres project. After I accepted, it was revealed to me that the Python part was inside postgres. An architectural decision that hinted something about the mind that made it, but technically, it worked flawlessly.

Re: Ask HN: Is PostgreSQL better than MySQL?

#33
post #9
post #6

DDL ends a transaction in MySQL. In my opinion, this is a showstopper and deal breaker. Good luck failing a migration in production.

Do people still use pt-online-schema-change for production schema changes? I remember using it a long time ago.

Django just does it, run those migrations all the way through dev -> test -> prod.

Look ma, no DBA required.

Re: Ask HN: Is PostgreSQL better than MySQL?

#34
post #9
post #6

DDL ends a transaction in MySQL. In my opinion, this is a showstopper and deal breaker. Good luck failing a migration in production.

Do people still use pt-online-schema-change for production schema changes? I remember using it a long time ago.

Unfortunately yes, but as always only for the type of time-consuming DDL changes that incur a write block in a situation where you just can't have the production environment stall or wait that long. The past 5-10 years have seen several improvements allowing some types of schema changes to be done "online" without blocking writes.

Re: Ask HN: Is PostgreSQL better than MySQL?

#35
post #6

DDL ends a transaction in MySQL. In my opinion, this is a showstopper and deal breaker. Good luck failing a migration in production.

A little history, I used: - MySQL from about 1999-2007 - Postgres from 2006-present - Oracle at a job 4 years ago One of the things that absolutely made my brain explode is that Oracle, too, does not support DDL transactions. I discovered this during a pretty funny code review. “Why are you wrapping this DDL in a transaction? That’s pointless.” “Wait… Oracle doesn’t support DDL transactions?” “What do you mean ‘DDL t…

Your reviewer immediately made a suggestion that you're just unqualified? Well, I shouldn't be so surprised, it's a company that chose to use Oracle after all...

Re: Ask HN: Is PostgreSQL better than MySQL?

#36

As a software engineer that worked with a lot of different databases in the last 20 years I have come to believe that PostgreSQL is even better than Oracle (this will certainly spark some fires). I have had shit with a lot of databases but never with PostgreSQL. MySQL has some really nasty documented and undocumented "features" so I rather avoid that database. It has it's place in the universe but it's in on a differ…

When I started in the biz around 2000 any serious tech business running Oracle or maybe SQL Server if they were MS stack. Oracle was miles ahead of everyone else. In the last ten years I don't think I've seen a single org that still runs Oracle. It's legacy at this point. SQL server has surprisingly hung on, but everyone else is using something open source or something cloud.

Re: Ask HN: Is PostgreSQL better than MySQL?

#37

It depends: the projects make different trade offs and support different points of extension. I find it useful to remember that MySQL has various storage engines (that make different trade offs, and may themselves have different options such as various row formats), when using for instance the default of InnoDB knowing that it uses index organized (meaning stores the data in a btree as opposed to heap) tables can inf…

I think this is a good answer. Our case is weird; millions of tables with billions (not sure how many in total even) of rows and no joins. Mysql handles this far better in our testing.

Re: Ask HN: Is PostgreSQL better than MySQL?

#38
I've used both for similar amounts of time at this point. I know a _lot_ about the implementations details of MySQL, and a helluva lot less about PostgreSQL, and that's because I hit _way_ more landmines with MySQL. It's just so easy to use it the wrong way and get saddled with ugly problems for months or years.

To be fair, my PostgreSQL experience is more recent, and both products have matured a bunch, but I've also seen plenty of the bad old MySQL problems—like MyISAM tables and 3-byte unicode—in just the last couple of years.

Re: Ask HN: Is PostgreSQL better than MySQL?

#39
post #10

The philosophy of postgresql was to do the best possible job the rightest way. Not necessarily the easiest to use nor fastest. The philosophy of mysql was to do the best it can as fast as it can for as many users as it can. Not necessarily the 'right' or 'best' way. Its not like either philosophy is formally documented or mandatory but "generally" matches up pretty closely to real world behavior. The biggest problem…

25 years ago the people behind MySQL said that you didn't need transactions, quit asking for them. They didn't understand any of ACID really. Since then the project has got the important features, but I still have a bad taste in my mouth from the at the time leaders.

25 years ago postgresql was clearly a slow DB, but they didn't claim you didn't need performance, just that you had to measure first to ensure you really did (nobody did that measure).

Things have changed. However my career ended up not needing much of a DB ever and so I've never had any need to see how much. I just like to watch the fights from the sidelines.

Post reply on HN