Live data from Hacker News

Ask HN: Is PostgreSQL better than MySQL?

news.ycombinator.com

1–10 of 83 posts

Ask HN: Is PostgreSQL better than MySQL?

#1
I hope this doesn't entice a flamewar, but speaking honestly here, whenever I discuss this (PostgreSQL vs MySQL) with folks working in the data space, PostgreSQL is always touted as the superior RDBMS.

Now I know that MySQL is the most popular (because there's a banner on mysql.com that says so! /s), and I get the sense that on raw speed alone, it's probably faster (this is purely anecdotal), but folks that use PostgreSQL speak about it with an air of superiority.

So I'm hoping some of you HN users can shed light on this, based on your experience.

Is there a clear winner, or is it purely a case of "it depends"?

(and if it's the latter, is there a generally agreed comparison list of pros and cons that I can refer to?)

Thanks!

Re: Ask HN: Is PostgreSQL better than MySQL?

#2
While I use MySQL extensively, I don't really know Postgres so I can't really compare the two. In my current project, I opted to use MySQL because Amazon Aurora didn't support Postgres at the time and I wanted replication performance and serverless autoscaling for a low level read workload that could be randomly very spiky.

Today, both databases are well supported as a service on major cloud platforms. Postgres does have some performance characteristics that lead Uber to drop it [0], but this in itself is not a reason to not choose it, because most teams don't have their kind of workload.

If I were to start a new project today however I would seriously consider Postgres given that Oracle is in my opinion fairly hostile. For example, they re-licensed the .NET driver from LGPL to GPL so that anyone updating would either have to buy a commercial license or open-source their entire product. While there are OSS .NET drivers, this move alone is enough to make me think twice about using it again for a future project.

[0] https://www.uber.com/en-RO/blog/postgres-to-mysql-migration/

Re: Ask HN: Is PostgreSQL better than MySQL?

#3
They’re fairly different, and have different pros and cons.

The main pro about postgresql is that it’s immensely versatile and can do an incredible amount of things.

The main pro about mysql is that there are some open source and battle-tested multi-master extensions for high availability.

Re: Ask HN: Is PostgreSQL better than MySQL?

#4
It's been a while since I've given serious thought to this question but I'm glad it's asked because I would like to re-learn and find out if those using it do so for the reasons I perceive PostgreSQL to be "superior" based on talk among peers. The basic "MySQL is faster but lighter on features" is what I recall hearing; also that PostgreSQL is "multi-paradigm" in that you can run document/NoSQL tables, ETL, and data warehousing all in one product. Then again, maybe MySQL supports JSON tables now as well and I just haven't noticed since my head has been in the AWS cloud and tied to Dynamo for the last three years.

Re: Ask HN: Is PostgreSQL better than MySQL?

#8
Depends what you mean by better. They're both mature databases with performance and characteristics that will suit a lot of use cases, so one is not clearly better than the other.

Having said that, my preference is for postgresql these days. It feels more ergonomic for the (fairly boring, normal database kinda stuff) things I do.

Re: Ask HN: Is PostgreSQL better than MySQL?

#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 you'll have evaluating them is both products are incredibly old and have changed over the decades so you'll find plenty of web search results DEMANDING that mysql can't do transactions, for example, because that was written 25 years ago and transactions were pretty much a solved problem some decades ago on mysql. Similar issues exist for tooling, library support, clustering, I wouldn't trust a many years old blog post for either product LOL.

Post reply on HN