Elxis CMS Forum

Support => General => Topic started by: muharihar on July 04, 2009, 02:53:45

Title: (PHP Library) ADODB vs PDO
Post by: muharihar on July 04, 2009, 02:53:45
Can anyone help me to describe the Advantage and Disadvantage about using ADODB vs PDO (PHP Library)?  ???

Thanks for helping... :)
Title: Re: (PHP Library) ADODB vs PDO
Post by: ks-net on July 04, 2009, 10:04:06
from  http://tonylandis.com/perfomance/php-adodb-pdo-mysql-database-apc-benchmark/

Quote
If performance is critical, don’t consider ADOdb unless an optimizer such as APC is installed. Even then, I do not recommend ADOdb unless ADOdb offers some critical feature that is missing in PDO. Even with APC installed the best run of ADOdb was 225% slower than with PDO.

Why? PDO is a native compiled library and not loaded at runtime.


from PhP manual :
 
Quote
The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can expose database-specific features as regular extension functions. Note that you cannot perform any database functions using the PDO extension by itself; you must use a database-specific PDO driver to access a database server.

PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.

so far as i know there are php applications that require pdo in order to run properly ... for all these i think pdo is the answer

And a note:
PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in the core of PHP 5, and so will not run with earlier versions of PHP.
Title: Re: (PHP Library) ADODB vs PDO
Post by: datahell on July 04, 2009, 18:09:29
In Elxis we chosen ADOdb as it is independent from the server software. It is very important a web application to run under any server environment without requiring extra software on the server. Off course PDO is faster as it is internal in PHP and not an external script. And even faster is to write directly mysql queries. Notice also that PDO will NOT rewrite you the queries to a database type specific form (f.e. suitable for oracle). You will need an external library for that.

http://tonylandis.com/perfomance/php-adodb-pdo-mysql-database-apc-benchmark/ (http://tonylandis.com/perfomance/php-adodb-pdo-mysql-database-apc-benchmark/)
Title: Re: (PHP Library) ADODB vs PDO
Post by: ks-net on July 04, 2009, 18:23:32
Quote
In Elxis we chosen ADOdb as it is independent from the server software
1 month ago i had to enable it  for a client that wanted to install magento in his hosting package ...
that's why i said before that  " there are php applications that require pdo in order to run properly"
so if you setup a server install or enable pdo...
if you develop an application then avoid pdo as there are many old servers out there and many people that can not update their server or hosting-plans due to several reasons

Title: Re: (PHP Library) ADODB vs PDO
Post by: datahell on July 05, 2009, 12:24:06
I read that PDO is built-in in PHP 5.x, but I am not sure. Is this true? If PDO is standard now then we can replace ADOdb with PDO in a future Elxis release.
Title: Re: (PHP Library) ADODB vs PDO
Post by: ks-net on July 05, 2009, 16:40:33
from php manual:
Quote
PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in the core of PHP 5, and so will not run with earlier versions of PHP.

so i think it is build in ... but needs to be enabled ...  centos have it disable(iam almost sure) in it's distribution... other os?
Title: Re: (PHP Library) ADODB vs PDO
Post by: muharihar on July 05, 2009, 17:22:01
Thanks for all the member for giving their info about ADOdb vs ADO  :).

If PDO is "valid" and more "powerfull" then ADOdb, i'm agree with datahell : "If PDO is standard now then we can replace ADOdb with PDO in a future Elxis release"  ;)
Title: Re: (PHP Library) ADODB vs PDO
Post by: datahell on July 05, 2009, 19:19:12
I guess ks-net is right, if PDO is disabled, even in some servers, then people wont be able to use Elxis on these servers and this is a huge problem. ADOdb is a global solution, not as fast as PDO but works good and runs everywhere. We will see this issue again in the future. Combination of ADOdb and APC is also an other option as together they almost reach PDO's performance.
Title: Re: (PHP Library) ADODB vs PDO
Post by: ks-net on July 05, 2009, 20:07:00
in my server was disabled... i don't now if it was by default or during installation or after admins disabled it ....  any way even now it supports mysql and sqlite drivers ONLY

in an ubuntu system is enabled in default installation BUT support ONLY  MYSQL driver .. not any other... how other installations will be?  who knows?

Although pdo supports a variety of drivers for various DB .. servers configurations not include them.   
list of drivers http://gr.php.net/manual/en/pdo.drivers.php

also the default installation of pdo won't include other drivers than mysql, sqlite
needs further configuration and seems that server administrators(as can see from installations) misses it.
http://gr.php.net/manual/en/pdo.installation.php
   

seems that is too soon to start thinking about pdo 

maybe till next version  things will be better
Title: Re: (PHP Library) ADODB vs PDO
Post by: datahell on July 05, 2009, 21:29:05
If, by default, there is only mysql support then we forget PDO... The purpose of a library like that is to provide cross database support.