Live data from Hacker News

Ask HN: PostgreSQL or MySQL?

news.ycombinator.com

111–120 of 181 posts

Re: Ask HN: PostgreSQL or MySQL?

#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 saved in JSON fields in a DB.

4. You can build a custom file based on anything. The only catch, the SQLite client will only read a valid SQLite file. As such, you have to know what you're doing.

[Edit] Formating

Re: Ask HN: PostgreSQL or MySQL?

#112
post #35
post #33

MySQL: Wait a sec, what do I use for this table, InnoDB or MyISAM? What are the tradeoffs again? Oh, right, do I want ACID transactions or fulltext search? Man, this tradeoff sucks. PostgreSQL: Wait a sec, which schema (namespace) should I put this table in? Man, it's nice to have namespaces within a DB.

No one has been using MyISAM for the last 10 years.

[deleted]

Re: Ask HN: PostgreSQL or MySQL?

#113
post #92
post #64

Earlier quoted context omitted.

But vanilla PG didn't get good master / slave feature until "recently" so you were running without replicas in the last 10 years? https://www.postgresql.org/about/news/1235/

Your link is from 9 years ago.

This happens when someone asks a versus question on a Sunday.

Re: Ask HN: PostgreSQL or MySQL?

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

My pet peeve is great software with incomplete documentation. All that hard work put into the code, just give us a quick example of how to actually use it! Especially where there is maybe a super superficial example, but missing examples of how to use the optional yet essential and non-straight forward arguments/features.

Oh! I have a much bigger pet peeve for projects which have a fine and moderately-usable examples section, but then decide that's good enough and never document the API because one should just "look at the examples".

Re: Ask HN: PostgreSQL or MySQL?

#115

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…

Not to mention TimescaleDB and PostGIS. If one ever needs analytics or GIS these are great additions. One doesn't have to support multiple DBs for that. Also Citus, but MySQL (well MariaDB and Percona) also has Galera cluster.

Also in MySQL alter table and drop table closes your transaction. One would argue it doesn't even have "real" transactions because of this.

Re: Ask HN: PostgreSQL or MySQL?

#116

Is there a Galera-equivalent system available of Postgres? I.e., multi-master replication. I know of BDR, but that doesn't seem to be publicly available for recent versions of Pg?

Not sure about master-master, but I've used repmgr[1] to manage a PostgreSQL master-slave setup and it works pretty well though it is by no-means plug and play. There are a variety of steps and manual processes to get it up and running.

[1] https://repmgr.org/

Re: Ask HN: PostgreSQL or MySQL?

#117

1. Mostly, Postgres, as it's superior in most areas, but MySQL seems to still have advantages in replication (and, if you are hosting in AWS, there Aurora Serverless MySQL offering supports somethings, like their own Data API, that the equivalent Postgres offering doesn't yet which may tip the balance. > Is it possible to build a hybrid database schema? For example, SQLite+JSON? Yes, but many DBs will hold JSON nativ…

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

Interesting. Do you have any links or further info? Evaluating setting up a standard PG RDS instance or going Aurora PG Serverless.

Re: Ask HN: PostgreSQL or MySQL?

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

Alas I found the docs hard to navigate, things are not hyperlinked that should be, and I think adding more examples would help.

Anyway, IMHO MySQL has similar level of documentation.

Re: Ask HN: PostgreSQL or MySQL?

#119
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. I especially love their "don't do this" page [0]

[0] https://wiki.postgresql.org/wiki/Don't_Do_This

Re: Ask HN: PostgreSQL or MySQL?

#120
post #92
post #64

Earlier quoted context omitted.

But vanilla PG didn't get good master / slave feature until "recently" so you were running without replicas in the last 10 years? https://www.postgresql.org/about/news/1235/

Your link is from 9 years ago.

The release from 9 years ago was not even close to what MySQL was offering at the time.
Post reply on HN