NYCPHP Meetup

NYPHP.org

[nycphp-talk] if you were teaching PHP...

Hans Zaunere lists at zaunere.com
Tue Jan 18 16:04:41 EST 2005


> > That's exactly why database abstraction is a necessity - with PEAR's
> > DB or ADOdb it doesn't matter if you need mysql or mysqli (or any
> > other database)...

Yes, but you then don't get any of the benefit of a particular database's API.  Not to knock PEAR::DB, but it can't possibly be aware of each feature available in the various DB's.

> PEAR is in there, absolutely. The only question is which if any native PHP
> MySQL API to cover in addition.

Those who know me know I don't favor DB abstraction, so this will be biased, and frankly I don't know that much about PEAR::DB.  Can it support prepared statements?  Can it support cursors (server side)?  Can it support collation? etc...

While DB abstraction can be useful for simple apps, and is something worth learning about, large applications never use generic abstraction, since they are rarely deployed on multiple databases.

That said, abstraction within the application - that is, "custom" abstraction written specifically in the application, and for their database - can add a lot of value, since it can expose the needed features for that db/app combo.  Lastly, knowing how a database works, and thus how to talk to it in the most efficient manner, is central in a successful and scalable application.


---
Hans Zaunere
President, Founder
New York PHP
http://www.nyphp.org

Gmail: The 1gb spam catcher 







More information about the talk mailing list