Re: [CDBI] How well does Class::DBI scale?

[prev] [thread] [next] [Date index for 2005/12/20]

From: John Siracusa
Subject: Re: [CDBI] How well does Class::DBI scale?
Date: 01:37 on 20 Dec 2005
On 12/19/05 8:24 PM, Matt S Trout wrote:
> Of course, if you're refactoring substantially, it's but a short step to
> just port the code to DBIx::Class which has the same features and much less
> perl overhead, and not *so* much longer a step to Rose::DB::Object which
> is rather more different but faster still (speed here in terms of perl
> overhead; the SQL optimisation achievable with each is probably fairly
> similar provided we're comparing Sweet and not plain Class::DBI).

Well, it depends on how your db performs when doing JOINs.
Class::DBI::Sweet, DBIx::Class, and Rose::DB::Object can all auto-join
tables when one row from the main table has one row in a related table.
This is almost always a performance win when compared to doing individual
queries for each related row.

Uniquely, Rose::DB::Object can also auto-join tables related via "one to
many" and "many to many" relationships.  This is also a performance win if
you're using a decent database, but it's possible to go overboard by joining
via too many "... to many" relationships and ending up swamped with
redundant data.

I don't know what your table relationships look like, so I can't comment on
which of the modules or approaches will help you.  But judging by the number
of queries you're running alone, I can tell you that using an ORM without
any support for automatic JOINs and then using that ORM to fetch your data
is probably a bad idea :)

Whether you just need 1-to-1 JOIN support, or would benefit from 1-to-n and
n-to-n JOIN support as well, I don't know.  Maybe you actually need to do
custom SQL no matter what.  Again, it's hard to tell without knowing the
table structures.

Anyway, the Rose::DB::Object module distribution includes a Perl ORM
benchmark suite that compares all the modules listed earlier, including
CDBI.  You can see some results here:

http://rose.sourceforge.net/wiki/index.php/RDBO/Benchmark

or download the becnchmark from CPAN and run it yourself.  If you want to
see how much benefit you might get from using the auto-JOIN features of
another ORM, take a look at the "search with ... sub-object" test results in
particular.

-John



_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] How well does Class::DBI scale?
Rick Welykochy 03:29 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Sam Tregar 04:37 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Rick Welykochy 05:24 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Bill Moseley 14:42 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Rick Welykochy 23:05 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Perrin Harkins 05:33 on 19 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Dave Howorth 13:42 on 19 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Perrin Harkins 17:04 on 19 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Rick Welykochy 00:41 on 20 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Perrin Harkins 16:42 on 18 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Matt S Trout 01:24 on 20 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
John Siracusa 01:37 on 20 Dec 2005

Re: [CDBI] How well does Class::DBI scale?
Rick Welykochy 04:30 on 22 Jan 2006

Re: [CDBI] How well does Class::DBI scale?
Aaron Trevena 15:05 on 22 Jan 2006

Re: [CDBI] How well does Class::DBI scale?
Rick Welykochy 22:56 on 22 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52