Posted Jul 30, 2010 3:45 UTC (Fri) by ringerc (subscriber, #3071)
Parent article: OSCON: Building communities
Interesting. There was just a discussion on the Postgresql-GENERAL list wondering why MySQL is the default go-to database in OSS circles, and so much more popular. Nobody's quite sure why, though the fact that it's easier to run multi-tenanted (for hosting) came up.
Given the mention here of MySQL being a notably good choice to base Drupal on (because of it's popularity) I thought I'd ask for opinions here on why folks are using MySQL over Pg. I don't "MySQL vs Pg" comparisons; it's not about which is better so much about why you use one or the other, as both have technical strong and weak points.
Is this mostly historical, from the days when MySQL was fast but liked to eat your data (MyISAM) and PostgreSQL was just slooooooow and buggy? Neither of these things are true anymore, but if database choices were made then it'd influence long-term popularity and mind-share.
Posted Jul 31, 2010 16:00 UTC (Sat) by ccurtis (guest, #49713)
[Link]
I started playing with databases in 1995 or so, and MySQL was somehow the HotNewThing. It was sold as being aligned with this newfangled web stuff (fastest for reading, which is what most web stuff is (was)), and PHP had good support for it. I happened to be using PHP because I preferred the C-like syntax (versus Perl's 'linenoise') so it was a combo that just gelled early -- web + php + mysql.
I've toyed with Postgres but the interface is completely foreign to me. In MySQL, it's not exactly easy but you can generally figure out how to setup different access rights to different databases by manipulating the 'mysql' table. I have no idea how to do this is Postgres. In the past, I typed 'pg_createdb' (something like that) and suddenly I had a database somewhere ... I assume. Presumably it was tied to my account, as it never asked for a password, and therefore disallowed all collaboration and remote access (eg, me and the web server on another machine).
"How is this useful?" was my response, as I was also working as a SysAdmin at the time. Others in the lab may have been using it - nobody had asked for it explicitly - but people were using MySQL. I also think its limited SQL syntax (no subselects, foreign keys, etc.) made learning it a bit simpler as there wasn't as much to know to get started. The documentation was prominent and generally well written.
Why MySQL remains preferred over Postgres at this point is most likely simple momentum. It will be interesting to see what Oracle does with MySQL though. I think that (and this is pure conjecture) there is something of a database renaissance underway, and Postgres could have a future there. Which is to say that I think a window is opening where the tables could change (no pun intended).
I still think of MySQL as the Web Database without stored procedures, and as the new web model seems to be going towards multiple independent code bases accessing the same data, the tighter you can tie data and data validation the better. I know there are projects that use database views as their API, with triggers and stored procedures to maintain compatibility between versions. There's also talk of putting the UI into the database so that the application can be either web, java, or native code and can just pull out the interface elements from the DB.
Perhaps this is all old-hat (or completely invalid) by now, but my perception is still that of Postgres = completeness and cutting-edge database features (ACID, strict SQL syntax support, technical miscellaneous-ness) and MySQL = practical stuff now (leaving out esoteric SQL in trade for better speed, master-master replication).
Now, I'm not saying anything other than these are my thoughts and perceptions, and I don't claim to be a large DB user. When I do install DBs on my machines, it's usually MySQL because I'm familiar with it and it's what I tend to run into out in the wild. When I last installed Postgres it talked to me about configuring my cluster and my thought was that I had clearly installed something far more complex than what I needed.