in reply to DBI and wrappers etc confusion.

Wrappers are there to keep your code clean and readable at the expense of performance. In general, the more the wrapper abstracts, the less efficient it is.

Sometimes you need extreme performance, and in that case raw DBI is the best solution.

Wrappers are simplified interfaces. That means that if you use a wrapper, some things may not be possible. But the things that are possible, will be much easier and require less code.

I made DBIx::Simple for people who don't mind cluttering their code with SQL queries. It can't be as fast as raw DBI, but it is much easier to use.

If you don't mind a huge performance hit, and you want to keep your code extremely clean, try Class::DBI. I've used it in several projects and really love it. Unfortunately, something that abstracts as much as this does, cannot be made much faster than it is.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re: Re: DBI and wrappers etc confusion.
by jdtoronto (Prior) on Aug 20, 2003 at 04:44 UTC
    Thanks Juerd,

    DBIx::Simple is one I have installed to have a play with and the same with DBI::Class.

    Your remarks about performance are noted. I have one programme that work with a database of around 2 million records, Perl/DBI/MySQL is vastly faster than the MS-Access/VBA application it has replaced, but when I tried a version using some of the wrappers (I didn't record which gave what performance, just notes of preference) the performance sometimes took a hit of a factor of 3 to 10.

    But I have a lot more playing to do yet!

    jdtoronto