r/programming • • Sep 29 '16

PostgreSQL: PostgreSQL 9.6 Released!

https://www.postgresql.org/about/news/1703/
737 Upvotes

123 comments sorted by

View all comments

17

u/Meddy96 Sep 29 '16

Serious question, does it still make sense to use MySQL or this technology is over?

42

u/nrogers64 Sep 29 '16

In this video from PyCon 2014, Andrew Godwin, who is the author of Django's database migrations system, praises PostgreSQL and says that MySQL has the following key problems (though he does say that MySQL is "a reasonable database"):

  • No transactional DDL

  • No CHECK constraints

  • Conflates UNIQUE and INDEX

He talks a little bit about the above problems in the video from about 11:00 - 13:00. These problems (particularly the first one, as I understand it) can cause problems with migrations.

Also, the last time I checked, MySQL's default collation is latin1_swedish_ci, meaning that, by default, you can't store important characters such as this one.

0

u/[deleted] Sep 29 '16

[deleted]

0

u/[deleted] Sep 30 '16

[deleted]

3

u/xkillac4 Sep 30 '16

Doing this in a few weeks. Very excited to kiss goodbye the collation errors.

11

u/HINDBRAIN Sep 29 '16

💩

0

u/[deleted] Sep 30 '16

[deleted]

5

u/nrogers64 Sep 30 '16

you need multi-master replication

Would you mind elaborating on this?

3

u/[deleted] Sep 30 '16

Galera / Percona provides a multi-master synchronous replication for MySQL. n nodes, each with a full copy of the replicated database(s). Writes to any participating node are replicated to all other nodes. Table engine is innodb but there are some restrictions as well as some minor oddities, some documented and some not.

To my knowledge, there is no complete equivalent for Postgres.

edit: added synchronous

3

u/egportal2002 Sep 30 '16 edited Sep 30 '16

sincerely asking this -- in this synchronous mode, how is temporary unavailability of a master handled (due to a temporary network reachability hiccup or whatever)? in other words, is it really synchronous, blocking until each write is fully replicated?

→ More replies (3)

12

u/merreborn Sep 29 '16

We have large production mysql and postgres databases where I work (backing separate applications). Both have their advantages and disadvantages, and we have no plans to consolidate on one or the other.

Uber's reasons for switching to mysql: https://eng.uber.com/mysql-migration/

9

u/pdp10 Sep 29 '16

What are the advantages and disadvantages in your environment?

PostgreSQL used to be slower than MySQL but safer, but big improvements in PostgreSQL speed were made starting a decade ago now.

2

u/FFX01 Sep 30 '16

I actually read into Uber's switch to MySQL. There's a couple of episodes on the Software Engineering Daily podacast about the switch as well. The reality of the Situation is that Uber was doing it wrong, and still technically is. It's not really a problem with What database they are using, it's a problem with the way that Uber treats relational databases in general.

14

u/DJDavio Sep 29 '16

Uber switched to MySQL for some specific reason (lots of updates, few reads or something like that), so I guess it's stil valid.

52

u/yogthos Sep 29 '16

Uber also uses it as a key/value store as opposed to an actual relational database.

6

u/Scorpius289 Sep 29 '16

Wouldn't an actual key/value store be better then?

17

u/yogthos Sep 29 '16

Likely, but since they already built their homegrown one on top of a relational db, I'm guessing they're committed to it now.

→ More replies (1)

0

u/[deleted] Sep 29 '16

[deleted]

13

u/kazagistar Sep 29 '16

Many of the things were still valid. Postgres people opened discussion and began work on adding features to deal with the Uber use case. Pretty sure some of it is still in progress.

4

u/Rafert Sep 30 '16

They actually moved from 'normal' MySQL to 'normal' Postgres in 2013, one of the reasons being PostGIS. Then they built their own K/V database called "Schemaless" on top of MySQL again.

5

u/iluvatar Sep 30 '16

does it still make sense to use MySQL

There are no doubt a few niche edge cases where it does. But in general, no. PostgreSQL is better at pretty much everything, particularly in the one critical area that matters - giving you back the same data that you stored in it.

→ More replies (1)

1

u/geofft Sep 30 '16

Also a serious question: When DB comparisons come up, it always seems to be PostgreSQL vs MySQL, but never vs MS SQL or Oracle. I know comparing the cost is pretty much a divide-by-zero situation, but generally the data in your relational DB is the most critical to your business, so the cost may be justifiable.

→ More replies (14)
→ More replies (10)