Forum OpenACS Q&A: Response to Continuing TCL Development / Beginning Java.

Posted by Roberto Mello on
"Bill -- you left out a vital part of the equation: finding a host that supports PostgreSQL. PostgreSQL is more complicated to set up & resource-intensive in a virtual server situation than MySQL, which is why very few hosting services offer it."

I don't think PostgreSQL is any harder to setup than MySQL. Both are very easy to setup and get going. In fact, I think PostgreSQL is easier to setup, since I don't need to login as root and enter a bunch of 'Y's and 'N's to each user in the SQL terminal, as in MySQL.

As for PG being more resource intensive, this may also be an illusion. Just because MySQL is multithreaded does not mean that it's "lighter" than PG, since threads in Linux are just lightweight processes. Beware of MySQL's MS-style marketing.

The real reason for MySQL being offered in more ISP/co-location facilities, IMHO, is that from day one PHP and its developers have pushed MySQL, and only MySQL (until very recently). PHP always worked better with MySQL, PHP's documentation for it is better, and so newbies just ask for it when starting on their MySQL development, probably thinking that their "scripts" would run better on it.

The supposition that PG may be more resource intensive that MySQL may also come from the fact that PHP manages db connections so horribly. When I ran PHP for my software engineering project (granted, it was under AOLserver, but the DB connections shouldn't be affected by that) I had to give up using persistent connections simply because... they were not reused.

The clients would come in, PHP would open a connection, but never reuse it. When another client would make a request, another connection would be openned. In a few minutes, with puny 2 clients hitting my machine, I had over 30 connections open!

If this behaviour also happens under the Apache module, then I doubt any ISP will let people use persistent connections, and so it's probably true that PG is more resource intensive.