RealSelf.com - 1.5 million monthly visitors
Rate Topic:
16 Votes

Can you be a little bit more specific on about DB operations topic? Can mention some numbers on what percent of DB-related operations in RealSelf.com are done via ActiveRecord and how many via DAO? Do you see any serious performance degrade / difference between these two methods? Are there any parts of code that are using pure PDO object, leaving all that comes with Yii behind?

All of our form queries use ActiveRecord. We use DAO for many of our complex select statements on model views. It makes sense to use an explicit query with DAO when that query will be run millions of times before a schema change occurs.

BTW, I'm on vacation for the next 2 weeks so expect replies after the 24th.

All of our form queries use ActiveRecord. We use DAO for many of our complex select statements on model views. It makes sense to use an explicit query with DAO when that query will be run millions of times before a schema change occurs.

BTW, I'm on vacation for the next 2 weeks so expect replies after the 24th.

Make sure you turn on schema caching for AR. Otherwise, a lot of time in AR would be spent in retrieving schema information. With proper configuration, AR should lower the performance of DAO/PDO by 50% or less.

I know that it's working fine, I was just wondering if there is a gap between mysql and postgresql

StErMi, as far as I'm concern we are not discussing a gap between two different RDBMSes here but the difference (gap) between using an older framework and switching to Yii with using the same RDBMS. Only this way you can correctly evaluate performance change between frameworks and that's what this topic started from (though got a bit off-topic by the way! :])