NYCPHP Meetup

NYPHP.org

[nycphp-talk] data modelling vs. db design (was: ER Diagram tool for MySQL/OS X)

Mitch Pirtle mitch.pirtle at gmail.com
Wed Oct 5 17:12:05 EDT 2005


On 10/5/05, cliff <cliff at pinestream.com> wrote:
> Regarding another point previously made in this thread: MySQL versus
> Postgres. MySQL seems to have all the momentum, yet a previous poster gave
> the impression that Postgres is more advanced. Should we be looking at
> Postgres more seriously despite the MySQL onslaught? Why does it seem like
> PHP/MySQL has become one word -- like Wintel -- instead of PHP/Postgres?

In a nutshell, PostgreSQL started out with one primary goal, SQL
compliance (and that means features). MySQL however started out with
only three goals - speed, speed, and more speed.

While PostgreSQL found that so many features required a tremendous
amount of refactoring and tuning to get performance and stability up
to a reasonable level, MySQL was under constant pressure to add
features that every other database had. (I remember joking, and not
that long ago, that the only database that has as few features as
MySQL was Access, and at the time Access had more features LOL)

So PostgreSQL started out really fat, with a ton of features, and had
major speed and stability issues. We are talking *major* speed and
stability issues. And MySQL started out really fast, unbelievably
fast, but had almost no capabilities, and no way to ensure clean,
consistent data - like spreadsheets for linux webservers.

Talk about opposite ends of the spectrum!

I think that they are now basically meeting in the middle, with
PostgreSQL is just as fast as any other database out there, and I have
seen PostgreSQL perform better than most for very sophisticated
designs; and MySQL has lost all of that legendary speed in order to
implement features that keep it competitive with other database
offerings.

My philosophical choice of PostgreSQL over MySQL has really only one
important point:

1) They are meeting in the middle, but PostgreSQL has had most of this
functionality for *years*. Maybe MySQL is finally getting around to
adding the stuff I require, but PostgreSQL has had it for a loooong
time, and it is absolutely bazooka proof at this point.

It's there, it's free (BSD license), why the heck not? ;-)

Perhaps most importantly, the decision for you (the web developer)
should really boil down to this one question: Where are you planning
on implementing the "business rules" of your application?

If you want to put logic in your database, you should look at
PostgreSQL, and if you want to put that logic in your code then MySQL
or PostgreSQL would most likely suffice. There are some very emotional
people out there on this topic (me included!) but perhaps this is more
of a personal preference than scientific conclusion. Would love to
hear other thoughts on this!

As for the popularity comparison...

MySQL has always had a better press relationship than PostgreSQL. Also
consider that MySQL was easy for folks to learn, because it really
could not do much more than store data anyway. With a commercial
entity behind MySQL, there was a budget for advertising, and
evangelism was a priority for them - whereas PostgreSQL has had many
supporters that had absolutely no interest in the market, and made no
effort to spread the word.

Another thing is that now as both PHP and MySQL gain complexity as
they mature, PostgreSQL will most likely not be perceived as such a
complex beast anymore.

For me, PostgreSQL is always the default, regardless of the
application, unless the client demands a commercial database.

Here is an interesting read, on what the databases do incorrectly or poorly:

MySQL Gotchas:
http://sql-info.de/mysql/gotchas.html

PostgreSQL Gotchas:
http://sql-info.de/postgresql/postgres-gotchas.html

-- Mitch



More information about the talk mailing list