News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Database Abstraction Layers in PHP. PDO versus DBAL
July 12, 2011 @ 10:14:29

In this new post to his blog, Gonzalo Ayuso compares two technologies that can make working with databases in your applications simpler - PDO and the Doctrine2 DBAL layer.

In fact DBAL isn't a pure database abstraction layer. It's built over PDO. It's a set of PHP classes we can use that gives us features not available with 'pure' PDO. If we use Doctrine2 we're using DBAL behind the scene, but we don't need to use Doctrine2 to use DBAL. We can use DBAL as a database abstraction layer without any ORM. Obiously this extra PHP layer over our PDO extension needs to pay a fee. I will have a look to this fee in this post.

He includes a few simple benchmarking scripts that compare similar operations done by either, including memory usage and execution time. PDO comes out on top, obviously, because it's an extension versus a set of PHP libraries that need to be included in the application. He does include examples of a few things he likes that DBAL does that PDO doesn't by default - a transactional mode, type conversion, a simpler binding interface and the ability to nest transactions.

0 comments voice your opinion now!
database abstraction doctrine2 dbal pdo layer benchmark feature


blog comments powered by Disqus

Similar Posts

Ibuildings techPortal: Using MongoDb in PHP Applications

Derick Rethans' Blog: Distributions: Please Don't Cripple PHP or Red Hat: Stop Fucking Around

Tobias Schlitt's Blog: Radar charts, MS SQL support, dialog system and greetings from spiderman!

DZone.com: Phar: PHP libraries included with a single file

SeeIT.com: The include() include_once() performance debate


Community Events





Don't see your event here?
Let us know!


developer code api framework release symfony application unittest community wordpress configure language threedevsandamaybe podcast introduction list install library interview series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework