views:

751

answers:

2

If I am using Zend_Db classes to abstract my queries from the backend database, does it make a difference which mysql driver I use, pdo_mysql vs. mysqli? My understanding of pdo_mysql is it is also to provide abstraction, so I'm assuming that if I am using Zend_Db, then I would not be taking advantage of the extra features as part of mysqli anyway. However, is one faster than the other from a performance perspective?

+2  A: 

Zend_Db, generally speaking, is based on PDO and its various adapters, like pdo_mysql.

The mysqli adapter has been developped only for those who are using servers / hosts that doesn't come with PDO.

I don't think there is much of a difference between pdo_mysql and mysqli, speaking of performance ; never heard of any -- so even if there is one, it shouldn't be that big.


The question I'd ask is : which adapters can you use in your application ?

Considering both pdo_mysql and mysqli allow to connect to a MySQL database, changing from one to the other should be quite easy : one line to change in your application's config.ini file ; and everything should keep working...

Personnaly, I'd probably go with the PDO adapter -- and switch to mysqli only if necessary, depending on the availability of PDO on my server.
But that's more because I generally use PDO than for any other "good" reason ^^

Pascal MARTIN
A: 

I've not used the Zend_DB classes, but in my own (very non-rigourous) tests I've found PDO to be substantially faster than MySQLi.

http://www.robpoyntz.com/blog/?p=260

Rob