Page 1 of 1

AdoDB

Posted: Fri Mar 31, 2006 1:54 am
by alex.barylski
I've used it extensively in the past, mostly in commercial applications so customers can port from DB to DB and no other reason.

I'm in need of a custom database abstraction layer, so I thought I'd look into AdoDB to get some ideas...

The implementation is alot more complex than I would assume for a abstraction layer...

I'm aware it has or offers some advantages (like recordsets, etc) but what else are they doing other than just providing a generic API?

Are transactions provided even with non-supporting DB's???

Anyone familiar with the internals of AdoDB so I don't have to read the code myself? :P

How about a plain vanilla abstraction layer and nothing more...that I can use for ideas?

Although I was thinking of using recordsets :)

Cheers :)

Posted: Fri Mar 31, 2006 3:19 am
by Maugrim_The_Reaper
ADOdb only supports features native to the underlying DBMS in use - otherwise it will return a false on the function call or more likely ignore the query call, or return the SQL passed. Same goes for prepared statements, and other such advanced features.

It is indeed very complex, to my mind its far too complex. There is a lighter alternative called ADOdb-Lite which is a lot simpler, does much the same thing, but supports fewer DBMS's (not that it matters since generic SQL is only useful on a subset...).

Also be aware ADOdb's power is not only a generic API. It can be used to generate or at least choose from a selection of SQL commands specific to databases. PDO for PHP5 is often quoted as being a solution to abstraction layers but that's not totally true.

ADOdb also packages a lot of extra functionality - DateTime functions, PEAR compatibility functions, Meta functions (for collating meta information on tables, rows and the database itself), caching (intelligent caches native to DBMS are superior), Data Dictionary (representing a database structure as XML which can be translating into DBMS specific SQL for table creation or difference updates), and more besides... The complexity is that many of these are not always separate from the main class - ADOdb is not a modular library.

If you need more simplicity, ADOdb-Lite probably is easier to read and follow. I've been using it a lot recently and I've been modifying it to add a Performance Management log and monitor similar to that from ADOdb. Maybe it's more open to modification and ease of understanding since it's a lot smaller and uses a Module system for including extra features which ADODB just dumps into the main classes?

Posted: Fri Mar 31, 2006 10:51 am
by alex.barylski
I was aware of AdoDB lite, however I didn't realize it was a re-write (designed more modular, efficient, etc), I figured it was just AdoDB stripped of advanced functionality.

I'll look into it, thanks :)

Posted: Sat Apr 01, 2006 5:27 pm
by AKA Panama Jack
Hockey wrote:I was aware of AdoDB lite, however I didn't realize it was a re-write (designed more modular, efficient, etc), I figured it was just AdoDB stripped of advanced functionality.

I'll look into it, thanks :)
Yes, it's a complete rewrite. :)

I had been using ADOdb for a couple of years but notice that it was... well... bloated like a 2 day old dead cow lying in the desert sun. ;)

So I sat down and decided to rewrite the entire thing from the ground up gradually adding features while keeping the memory overhead and CPU load very small while increasing the execution speed and pages per second that could be generated. Many of the features from ADO are included now such as sessions (written to work far more efficiently), data dictionary, error handler, pear errors, exception handler, time module, XML Schemas and more.

I am currently working on adding a Meta module that includes all of the Meta functions. I figure I will have just about all of the functionality of ADOdb included in ADOdb Lite by some time this summer so it will be a complete replacement for ADOdb while being much smaller and faster.

There are still a number of databases that are not supported in ADOdb Lite but we do support a number of databases that ADOdb doesn't support.

And I think you will find the programming much easier to follow an understand.