Live data from Hacker News

Ask HN: PostgreSQL or MySQL?

news.ycombinator.com

101–110 of 181 posts

Re: Ask HN: PostgreSQL or MySQL?

#101
post #99

My company recently looked at MySQL vs PostgreSQL. While we chose Postgres there is one thing that stood out in my research, I haven't found any comments on this: We were looking at scalable, HA, possibly multi-DC workloads and such, and yes, relational DBs are not necessarily the right choice, but MySQL looked a bit better in this regard, especially for master-master replication. There are several high-profile teams…

Did you evaluate Citus as well?

Re: Ask HN: PostgreSQL or MySQL?

#102
post #69

Earlier quoted context omitted.

If the requirements are still up in the air, but you know that you're going to be storing some data, definitely go with a database, even if just a single SQLite file. Using plain files means figuring out the file format, which turns into a huge mess when requirements get tacked on later. The other option would be to store a JSON file or a bunch of JSON files in a directory, at which point you're building a shitty ver…

The grandparent comment is right about one thing: you need to figure out what your use case is, in order to make a good judgment call. “Some data” can mean a lot of things. Transactional data? Sure, get a sql database in. Images, video, or plain json documents? SQL databases are a poor fit there. One should also consider if they even need to manage data persistence. I’ve had success using Google Sheets as the backing…

This. Answer “pg!” without any clue of what the objective is, and you'll end up with surprises like “oh, you know, this is for a revolutionary concept where people can check in their source code at different stages of development, so that they have a history of their changes and can restore an older version if needed” or “hey, we've followed your expert recommendations but now we're facing some availability issue after a link to our shiny new search engine made the front page of HN and Slashdot”. Migrating from pg to git or SOLR is not really enjoyable, and you can't reuse much of what you've done (unlike when migrating one SQL database to another).

Re: Ask HN: PostgreSQL or MySQL?

#103
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…

This. By chance I started reading the manual for Postgres yesterday and it actually filled some holes I had in knowledge. It's amazingly structured and verbose with extremely clear examples. The PG manual is literally a 0-to-hero resource for everything SQL related.

Re: Ask HN: PostgreSQL or MySQL?

#104

I will respond only to Q1, taking the perspective of analytics and data science. Answer: PostgreSQL > MySQL Postgres implementation of SQL includes a few useful clauses that are useful for analytics that MySQL does not support. It used to be that MySQL had no window functions, and that made it wholly inferior to Postgres when it came to analytics. However, it seems MySQL began supporting window functions two years ag…

Having consulted for hundreds of analysts writing SQL to explore their data and create reports, I would agree with this assessment. Additionally, I tend to avoid recommending MySQL because of a strange behavior when using Group By. In Postgres, every column must be either aggregated or grouped by when using a grouping expression. In MySQL, this requirement is not present, and the ambiguity of the query is resolved by…

This was in older versions. From 5.7 ONLY_FULL_GROUP_BY is enabled by default.

Re: Ask HN: PostgreSQL or MySQL?

#105

Earlier quoted context omitted.

> InnoDB MVCC doesn't handle those well either; a long-running tx blocks the purge thread and causes a pile-up of old row versions. Remember that what they moved to isn't directly MySQL eitger, but only uses it underneath.

It's still MySQL/InnoDB under the hood. I don't follow your point -- why does it matter whether an application is talking directly to MySQL, vs using an intermediate service with a non-SQL API? If the intermediate service supports long-running transactions, you'll hit the same underlying issue regardless... If your point is that they also happened to move to a new access pattern that eliminated long-running transacti…

Yes, sorry, I didn't mean to imply that long running transactions were the only cause, but I believe I remember.

I just need to go back and read the conversation on the pg-general list, it was very good in that it did discuss that some of the issues mentioned by Uber were real. https://www.postgresql.org/message-id/579795DF.10502%40comma... and perhaps some other blogs from around the time this was being discussed.

Re: Ask HN: PostgreSQL or MySQL?

#108
Answering Q1: MySQL over Postgres. Postgres has 2 critical things going against it - The query optimizer is a mess - It's implementation of secondary indexes is not cache friendly, so it can be slow

Re: Ask HN: PostgreSQL or MySQL?

#109

I'm not a very tech savvy and know very little about databases. But I have read countless posts/comments over the years and everywhere everyone recommends postgres. Again, I have no clue about other database systems, but postgres documentation is just awesome. I believe you can practically everything from its documentation.

I find a comment like this to be underrated; it’s like a meta-analysis.

Re: Ask HN: PostgreSQL or MySQL?

#110

This entirely depends on the domain and data model, and unless you need SQL - mongodb should be a consideration too.

No. MongoDB has a track record of losing data and not actually providing durability. It is considered a joke in the professional community.

interesting: https://www.mongodb.com/jepsen

A lot of MongoDB users who wouldn't be considered a "joke" https://www.mongodb.com/who-uses-mongodb

Rather than listen to unqualified nonsense, they run tests. And gather facts to guide technology decisions. and yes, I work for MongoDB - just before anyone starts whining about disclosure You're welcome

Post reply on HN