Live data from Hacker News

Can PostgreSQL pickup where MySQL left off?

news.cnet.com

21–30 of 46 posts

Re: Can PostgreSQL pickup where MySQL left off?

#21
post #18
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

I can say from a web dev's perspective that the ubiquitousness of MySQL is only part of the allure (an important part though). MySQL makes simple stuff very easy to implement, it's a great solution if you just want your database to store your stuff and get out of the way. Sure, like any other DB it requires some expertise if you want performance, but it makes this incredibly simple. It just works and you don't spend…

Postgres has had auto-incrementing row ids for a while, see this example: https://gist.github.com/1178237

Re: Can PostgreSQL pickup where MySQL left off?

#22
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

When I first got into full-time pro web development (about a decade ago), I started learning PHP. Just about every tutorial I read or book I wished I could afford had 'MySQL' next to 'PHP' as though they were one in the same.

From there forward, any time I was looking into a new host, they ALL had both PHP and MySQL. Any job I was bidding, discussion I was having in IRC or on Forums, anywhere - the two came as a matching set. I can't say that's WHY it became more popular, but I've always assumed their popularity were closely aligned.

Re: Can PostgreSQL pickup where MySQL left off?

#23
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

MySQL got the wrong results faster.

I've always likened it to riding a bicycle downhill with no brakes. Yes, it's faster, but...

Of course, now they've converged a lot, with Postgresql getting significant speed upgrades, and Mysql having InnoDB, with a few 'minor details' like transactions.

Re: Can PostgreSQL pickup where MySQL left off?

#24
post #11
post #8

Earlier quoted context omitted.

The second half of your explanation, which boils down to "it's everywhere" makes sense now, but is only true because it was already in demand. That it was faster (for certain applications), easier and more reliable does make sense. I understand, for example why PHP got popular even though there were other options available at the time that I believe were better from a software engineering[0] perspective. Things get p…

For many people, including hosting admins, MySQL was the path of least resistance. MySQL required less maintenance than Postgres back in the day. It's pretty much exactly the same situation as with PHP. The tool created by mere mortals is usable by mere mortals, so they use it. The tool created by scholars is technically superior at core functions but is slightly more difficult or cumbersome to use so is used by fewe…

Counting public releases of non university projects sure, but at least according to the wiki page it has been under active development since 1986, with first release in 1989. Where Mysql started development in 1994.

Re: Can PostgreSQL pickup where MySQL left off?

#25
post #21
post #18

Earlier quoted context omitted.

I can say from a web dev's perspective that the ubiquitousness of MySQL is only part of the allure (an important part though). MySQL makes simple stuff very easy to implement, it's a great solution if you just want your database to store your stuff and get out of the way. Sure, like any other DB it requires some expertise if you want performance, but it makes this incredibly simple. It just works and you don't spend…

Postgres has had auto-incrementing row ids for a while, see this example: https://gist.github.com/1178237

I may be wrong, but isn't that just a syntactical shortcut for creating a separate sequence table?

Re: Can PostgreSQL pickup where MySQL left off?

#26
post #18
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

I can say from a web dev's perspective that the ubiquitousness of MySQL is only part of the allure (an important part though). MySQL makes simple stuff very easy to implement, it's a great solution if you just want your database to store your stuff and get out of the way. Sure, like any other DB it requires some expertise if you want performance, but it makes this incredibly simple. It just works and you don't spend…

> It also has a single feature that I find incredibly cool: it supports automatically generated row IDs. It's been a while since I last tried Oracle and Postgres, but at the time you had to create a second table just for a sequence number and it was extremely awkward to handle.

Must have been a while indeed. Postgres's SERIAL datatype has been available at least since 6.4. Postgres 6.4 was released in 1998.

Re: Can PostgreSQL pickup where MySQL left off?

#27
post #25
post #21

Earlier quoted context omitted.

Postgres has had auto-incrementing row ids for a while, see this example: https://gist.github.com/1178237

I may be wrong, but isn't that just a syntactical shortcut for creating a separate sequence table?

Yes (that's noted in the gist). But the end result's the same, instead of writing AUTOINCREMENT you write SERIAL. That's about it, the only issue may happen if you drop the table (the sequence will not be dropped, not a huge issue in practice)

Re: Can PostgreSQL pickup where MySQL left off?

#28
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

MySQL was popular for the same reason No-SQL is - it lacked features, but it was fast as hell with no tuning. Postgres did more, so it had to be slower, and it was tuned to work on minimal resources (and not steal all your RAM). Like MongoDB today, MySQL was tuned to work fast, at the costs of both reliability, and being a poor citizen on a shared host.

There are other factors - you could limit its use of disk space (so hosts liked it), but mostly it was a good key-value store with some database functionality.

People who wanted a "real" database used Postgres. People who wanted to write a web app used MySQL.

Re: Can PostgreSQL pickup where MySQL left off?

#29
post #25

Earlier quoted context omitted.

I may be wrong, but isn't that just a syntactical shortcut for creating a separate sequence table?

Yes (that's noted in the gist). But the end result's the same, instead of writing AUTOINCREMENT you write SERIAL. That's about it, the only issue may happen if you drop the table (the sequence will not be dropped, not a huge issue in practice)

Did you notice any differences in performance?

Edit: I'm not saying there are, but it feels like there might be some repercussions when you take the underlying implementation into account. It would be interesting to know if someone conducted comparative tests about this.

Re: Can PostgreSQL pickup where MySQL left off?

#30
post #13
post #4

I wonder why MySQL became super-popular and Postgres didn't. I remember reading for years about how Postgres had a bunch of stuff (e.g. transactions) that MySQL didn't (until recently) and that anybody who knew anything about databases would choose Postgres, yet people still chose MySQL. What did MySQL have during the last decade that made it better for certain applications than Postgres?

MySQL is a triumph of branding and fanboy self-delusion. MySQL made it easier initially by omitting lots of difficult stuff (data integrity, management, transactions) thus making easier to get something working quickly. It also had a reputation for being faster then PostgreSQL, a reputation spread by fanboys (in truth people who were bigging up the only database they had a faint comprehension of). Then it became ubiq…

> It also had a reputation for being faster then PostgreSQL

It was indeed much faster when reading (probably still is on MyISAM) due to the lack of everything (especially transactions and any concept of data integrity).

Post reply on HN