Live data from Hacker News

Ask HN: PostgreSQL or MySQL?

news.ycombinator.com

171–180 of 181 posts

Re: Ask HN: PostgreSQL or MySQL?

#171

Earlier quoted context omitted.

> You say that FB is using MySQL because "changing is basically impractical", but also say MyRocks "provided major wins", which seems to be a contradiction. I think I must not be expressing myself clearly. 3+ year projects involving a large number of teams to get back to where you started are impractical. That's what migrating to PostgreSQL would be. Perhaps I should have written "switching from MySQL to PostgreSQL w…

Apologies if I'm misunderstanding. To take a step back and paraphrase this subthread, as I understand it: * `dezzeus said MySQL was better for read-intensive workloads, Postgres better for mixed read/write * I replied saying there are a number of huge social networks with insane write rates, which is contrary proof against that claim. (Having personally spent most of the past decade working on massive-scale MySQL at…

I think I have done a poor job of communicating, and I'm sorry for it.

Re: Ask HN: PostgreSQL or MySQL?

#172

Earlier quoted context omitted.

Aurora PG Serverless is out as of July, but I’ve read some horror stories about it so far.

Don't know about horror stories, but Aurora PG Serverless doesn't (yet?) have the Data API support (which enables a couple of other Aurora serverless features) that Aurora MySQL Serverless has, and IIRC has some other feature limitations that aren't directly tied to Data API.

Data API now supports Aurora PG Serverless, https://aws.amazon.com/about-aws/whats-new/2019/09/amazon-au...

Re: Ask HN: PostgreSQL or MySQL?

#173

1. For small databases (up to a few GB) my personal preference in the past 5 years was MS SQL (Express Edition, free), then PostgreSQL and last is MySQL. That means the answer to your specific question, PostgreSQL. Why? That is the order of features, ease of use and performance in my experience, other people may have seen different. For larger databases I have no experience with either PostgreSQL or MySQL, I was spoi…

MS SQL Server definitely has some important features that are missing from PG. Top on that list IMO is real stored procedures that can return multiple heterogeneous result-sets with simple select statements. Another big one is client side tools. Query optimization and schema flexibility (being able to alter things instead of dropping in re-creating) might still be not as good in PG as well. You won’t get a ton of agr…

Only this is not a way to select a DBMS. PostgreSQL adds important features much faster than competitors, it is free and much leaner and more flexible.

Re: Ask HN: PostgreSQL or MySQL?

#174
post #43

If you ask this at HN most likely it will be PostgreSQL. If you ask scripting language it got to be python or javascript here. I use HN daily and noticed as a group, HN readers do in general have their preference on things like this. By all means, MySQL's market share is much larger than PostgreSQL, and MySQL 8+ is very impressive. I compared both and eventually picked MySQL for my projects, even though I really _hat…

Wouldn't MySQL's market share be larger due to the historical usage in the LAMP stack?

Re: Ask HN: PostgreSQL or MySQL?

#175
post #11

EXPLAIN is almost useless on mysql, but very helpful in postgres. EXPLAIN is a very useful command once you have some degree of success (users).

Check EXPLAIN ANALYZE too as it's freshly baked into MySQL https://dev.mysql.com/doc/refman/8.0/en/explain.html#explain... especially useful if you switch from PosgreSQL to MySQL

Re: Ask HN: PostgreSQL or MySQL?

#176
post #61
post #6

The following isn’t the top reason I recommend Postgres, but is the reason I think least likely to be echoed in a dozen other comments: Postgres has some of the best documentation of any software product I’ve ever used. If someone wants to learn about SQL or databases, I always have to restrain myself from recommending that they just read the Postgres manual front to back. It’s comprehensive, it’s well written, it’s…

Too many Open Source developers discount the value of documentation. I all too often hear, "It's Open Source so the community should step up and write the documentation." To which I counter that the best person/people to at least start the documentation are the ones who build the product as they're the most knowledgeable about it. The community will gladly contribute. I personally believe that great documentation was…

Absolutely. Good, detailed, up to date documentation is one of my top priorities when selecting development tools, frameworks and software.

Re: Ask HN: PostgreSQL or MySQL?

#177

Earlier quoted context omitted.

MS SQL Server definitely has some important features that are missing from PG. Top on that list IMO is real stored procedures that can return multiple heterogeneous result-sets with simple select statements. Another big one is client side tools. Query optimization and schema flexibility (being able to alter things instead of dropping in re-creating) might still be not as good in PG as well. You won’t get a ton of agr…

Only this is not a way to select a DBMS. PostgreSQL adds important features much faster than competitors, it is free and much leaner and more flexible.

Free and leaner, yes. More flexible? That’s debatable. As I pointed out, it’s certainly not more flexible when it come to returning multiple result-sets from a single procedure.

I think that PG actually did just add a feature called stored procedures though. So maybe soon for returning multiple heterogeneous selects! It’s one feature that I’ve been waiting a long time for…

I chose SQL Server in many cases for it’s very high quality, support, superior ease of use and flexibility. Free and leaner weren’t very high on my list comparatively. You think those are the best characteristics to go by?

Re: Ask HN: PostgreSQL or MySQL?

#178

Earlier quoted context omitted.

MS SQL Server definitely has some important features that are missing from PG. Top on that list IMO is real stored procedures that can return multiple heterogeneous result-sets with simple select statements. Another big one is client side tools. Query optimization and schema flexibility (being able to alter things instead of dropping in re-creating) might still be not as good in PG as well. You won’t get a ton of agr…

Only this is not a way to select a DBMS. PostgreSQL adds important features much faster than competitors, it is free and much leaner and more flexible.

MS SQL Express Edition is also free and arguably more advanced than the free competition, I don't know a single way PostgreSQL is better. That does not make PostgreSQL bad at all, especially when you go beyond the limit of free MS SQL (10 GB per database) then PostgreSQL is my first choice.

Re: Ask HN: PostgreSQL or MySQL?

#179

1. PostgreSQL. Fast, reliable, (relatively) small (for some reason mysql got a lot bigger). Had a few historic problems with replication but I think that's been resolved. I dealt a lot with large scale large data sets and I wouldn't recommend mysql for that at all, except if they were very simple and relations were either not used or used minimally. There are better database systems than either, but I can't think of…

> I dealt a lot with large scale large data sets and I wouldn't recommend mysql for that at all Was your use-case transaction processing (OLTP) or analytics (OLAP)? There are a ton of examples of massive-scale MySQL deployments for OLTP... Facebook, YouTube, Pinterest, Slack, Uber, Wikipedia, GitHub, Yelp, Etsy, Shopify, Booking.com, Wordpress.com, Tumblr, Box, Dropbox, Alibaba, Square, Venmo... a large chunk of the…

analytics mysql was horrible for that, eventually bogging down to the point it was breaking the system down. Storing was ok. Analyzing emphatically was not.

And no amount of testimonies will counter that MySQL has a lot of fundamentally broken assumptions when it comes to data structure and relations. I mean it works if you don't mind handling that at higher levels, and sometimes that's a good call. And sometimes it's not.

Re: Ask HN: PostgreSQL or MySQL?

#180
post #111

1. Depends. If you have a lot of update queries, MySQL wins [ https://eng.uber.com/mysql-migration/ ]. MySQL also has better replication and sharding support at the moment. 2. PostgreSQL and MYSQL also sport JSON... JSON functions can be a little tricky. Still, they work. 3. Depends on the structure of your XML. Might even possible to use RegEx to achieve this objective. XML to JSON is easier though. That can be save…

That's incredibly well written, constructive feedback by the Uber team! I wonder if the Postgres team has taken this on board and attempted to resolve some of the design issues, e.g.: by moving the cache in-process.

The Uber team betrays their lack of knowledge about PostgreSQL in the article, so take it with a huge grain of salt. I recommend reading Markus Winand's article.

https://use-the-index-luke.com/blog/2016-07-29/on-ubers-choi...

But that does not mean though that there are not also real issues with table bloat in PostgreSQL, and they are being worked on by creating a new storage engine with a different MVCC implementation.

Post reply on HN