RE: [SMARTY] Smarty and DB Abstraction
| From: | LIMBOURG Arnaud | Date: | Mon, 10 Jun 2002 12:19:43 +0000 |
| Subject: | RE: [SMARTY] Smarty and DB Abstraction | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4723@lists.php.net to get a copy of this message | ||
Well, dbx is quite an old project and i don't think it'll come to something.
I don't even know if development is still going.
The problem with an extension is that everybody will not be able to load it.
Even for internal projects.
It's not as easy to make it evolve as php class is ...
> I may be reading this wrong, but it appears that dbx is a
> project underway
> to include a database abstraction layer in C code as a PHP
> extension. This
> should have a natural speed advantage over any PHP based
> abstraction class.
> The biggest drawback I see here so far is a lack of Oracle support.
>
> You may want to check out
> http://www.php.net/manual/en/ref.dbx.php
>
> Regards,
>
> Jason
> ----- Original Message -----
> From: "Peter Bowyer" <peter@mapledesign.co.uk>
> To: "pemphp" <pemphp@free.fr>; <smarty-general@lists.php.net>
> Sent: Monday, June 10, 2002 2:25 AM
> Subject: Re: [SMARTY] Smarty and DB Abstraction
>
>
> > At 08:54 10/06/02 +0200, pemphp wrote:
> > >Hi,
> > >
> > >I work with Smarty for few months.
> > >I work already with Phplib DB class. I'm searching for another DB
> > >abstraction class.
> > >Have youever heard about a benchmark between different DB Solution
> > >(PEAR DB, ADODB, Phplib, ...)
> >
> > They fall into two classes for speed:
> > Native calls and PHPLib;
> > Proper abstraction: PEAR-DB, ADODB, MDB;
> >
> > PHPLib is so fast because it is a poorly written class, and
> hence has a
> > speed advantage. Quoting Kristian Koehntopp
> <kris@koehntopp.de>, the
> > author of PHPLib:
> > "From an OO design POV phplib has extremely badly designed database
> > classes. That's why they are that fast. :-)
> >
> > No, really, PHPLIB was written on and for PHP3. That is an
> environment
> > where classes really are nothing more than namespaces, and where
> > state and code cannot be kept efficiently in memory, like
> for example
> > it would be possible in an application server and with
> truly compiled
> > code.
> >
> > OO design techniques strongly favor such an appserver execution
> > environment, and PHP does not offer such an environment at all,
> > in fact, it almost offers the antithesis to such an environment.
> >
> > PHPLIB was written with the particular execution model used in
> > PHP in mind and tested on sun4m hardware. That's why it performs
> > adequately, even today. It is not a bit fashionable, though."
> >
> > - ADODB has some nice features, but I hate its method names
> (they don't
> > make sense to me) and has a strange way of doing some
> things IMHO - that
> > should be separated into separate classed.
> > - PEAR-DB is slightly slower than ADODB, but has more
> comprehensive error
> > checking, and has a lovely API... which is also going to
> become the PHP
> > standard
> > - MDB is faster than PEAR-DB and is slowly being phased in
> to replace
> > it. It combines the abstraction capabilities of Metabase
> with PEAR-DB's
> API.
> >
> > >Is PEAR DB is really competitive ?
> >
> > Depends what you compare against :-)
> >
> > >Is there a good choice with Smarty ?
> >
> > I'd go for PEAR-DB as so many people are already using it,
> so if people
> > write extensions involving database interactions then
> that's a good chance
> > that this is the library that will be used.
> >
> > A lot of people fell for the hype about ADODB when John Lim
> released his
> > benchmarks - what he didn't point out was that he didn't
> benchmark the
> time
> > taken to compile the libraries in the first place, and the
> fact that his
> > queries were very simple. PEAR responded by writing a new
> release of
> > PEAR-DB that was as fast as ADODB, but it was never released - IIRC
> because
> > it messed up the class separation and error handling. So
> we're still
> stuck
> > with a slow DB abstraction layer :-)
> >
> > Here's some recent benchmarks off the PHPLib mailing list:
> > "I altered tests [that John Lim ran] and stated timing before any
> includes.
> > And I was surprised. For example, doing 1 query (after
> altering tests)
> > took: mysql: 0.03 sec, phplib: 0.06 sec, adodb: 0.14 sec,
> pear: 0.17 sec."
> >
> > And the ones produced for mdb:
> > http://www.dybnet.de/MDB/benchmarks.pdf
> >
> > HTH!
> > Peter
> >
> > --
> > Maple Design - quality web design and programming
> > http://www.mapledesign.co.uk
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>