Pdo_mysql vs mysqli when using Zend_Db

If I use Zend_Db classes to abstract my queries from the database database, does it matter which mysql driver I use, pdo_mysql vs. mysqli? My understanding of pdo_mysql is also providing an abstraction, so my guess is that if I'm using Zend_Db then I wouldn't use additional functions as part of mysqli anyway. However, is one faster than the other in terms of performance?

+2


source to share


2 answers


Zend_Db

is generally based on PDO and its various adapters such as pdo_mysql

.

The mysqli adapter was only designed for those using servers / hosts that don't have PDO.

I don't think there is much difference between pdo_mysql and mysqli when it comes to performance; never heard of anything, so even if it is, it shouldn't be that big.




The question I would ask is what adapters can your application use?

Given that both pdo_mysql

and mysqli

let you connect to a MySQL database, the transition from one to the other should be fairly simple: one line for changes in the config.ini file of the application; and everything should keep working ...

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

+4


source


I have not used the Zend_DB classes, but in my (very non-standard) tests I found that PDO will be significantly faster than MySQLi.



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

+3


source







All Articles