Re: [CDBI] Disabling %Live_Objects; creating a cache

[prev] [thread] [next] [Date index for 2006/01/13]

From: John Siracusa
Subject: Re: [CDBI] Disabling %Live_Objects; creating a cache
Date: 00:57 on 13 Jan 2006
On 1/12/06 7:19 PM, Perrin Harkins wrote:
> Caching database data is never all that easy.  There are complex issues
> involved.  You can try the caching in Class::DBI::Sweet or you can ditch
> Class::DBI and try Rose::DB::Object, which has caching.  I think you'll
> find it opens a can of worms, but may be worth it if your system is
> having performance problems.

Rose::DB::Object itself does not do any object caching.  Caching at the Perl
db object level is almost always a lot of effort for little gain.

That said, a subclass of Rose::DB::Object (appropriately named
Rose::DB::Object::Cached) that's bundled in the module distribution has
simple caching of single-object load() operations.  It's useful in a very
specific situation where you have a set of essentially "read-only" data in
the database that you load a row at a time. You can read more about it here:

http://search.cpan.org/dist/Rose-DB-Object/lib/Rose/DB/Object/Cached.pm

Keep I mind that Rose::DB::Object::Cached has nothing to do with
Rose::DB::Object's speed.  It is not used in the benchmark[1] suite at all.
It was created as an early proof-of-concept for subclassing, and lives on
because it's useful in the (somewhat rare) situation described above.

-John

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



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

[CDBI] Disabling %Live_Objects; creating a cache
Rick Welykochy 23:44 on 12 Jan 2006

Re: [CDBI] Disabling %Live_Objects; creating a cache
Perrin Harkins 00:19 on 13 Jan 2006

Re: [CDBI] Disabling %Live_Objects; creating a cache
John Siracusa 00:57 on 13 Jan 2006

Re: [CDBI] Disabling %Live_Objects; creating a cache
Rick Welykochy 01:09 on 13 Jan 2006

Re: [CDBI] Disabling %Live_Objects; creating a cache
=?ISO-8859-1?Q?Ask_Bj=F8rn_Hansen?= 01:46 on 13 Jan 2006

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