Yii - mysql vs postgresql

folks,

have u been using postgresql with yii for large sites? let say 100k daily visitor? if yes, how does it performance?

Hi Geek :)

The difference between MySQL or PostgreSQL mainly resides in the DBMS configuration, so if you configure MySQL in the wrong way it will be very slow (I always prefer MariaDB and Percona Server instead), and if you configures PostgreSQL very well it will be flying… btw, PostgreSQL v. 9.1 runs very fast out-of-the-box, speed very comparable to Mysql… so it is a good start.

Yii doesn’t care what DBMS are you using… Yii just connects the DB and queries it, the performance is the same.

@robregonm, thanks for your reply. i used to work with SQL server, i am newbies in opensource world. if i want to convert large scale web apps. which database would u recommend postgresql or mysql? do you think mysql is future proof? I mean after oracle bought mysql, will mysql be costly over postgresql in the future?

@geekmatter, I spent a lot of years as an Oracle DBA (along with some other RDBMSes).

Both products keep evolving. I don’t believe that Oracle is stupid enough to sabotage MySQL, especially after the backlash they received when they fumbled over the handling of OpenOffice. LibreOffice was born. Eventually, Oracle donated OpenOffice to Apache.

But even if Oracle damaged MySQL in some way, there are still numerous forks in the wild. Postgresql has a few forks of its own, for that matter. If I were making a decision between the two, I’d look at the database requirements of the app, and see if either solution was lacking. Real world performance is going to depend on 1) configuration, and 2) features, with some features likely performing better in MySQL than Postgresql and vice versa.

See MySQL vs Postgresql

@bglee: thanks for your reply. your personal preference, which database would you choose? we have large site web apps which has 5 million user, and 100k unique visitor daily.

@geekmatter, as I said, it would depend on the details of the app. I can tell you that my personal bias has always been towards Postgresql even though I’ve used MySQL more on web projects. Postgresql was probably the natural choice for DBAs who learned databases in the commercial space. Transactions, referential integrity through foreign keys, triggers, stored procedures, etc. were all available in Postgresql long before MySQL knew what any of it meant. MySQL has done a lot of catching up in recent years, so the feature sets are a lot closer. Which ever one you end up choosing, find a good DBA for the one you’ll be using or be prepared to learn how to size and tune appropriately.