[CDBI] Disabling %Live_Objects; creating a cache

Rick Welykochy rick at praxis.com.au
Fri Jan 13 01:09:43 GMT 2006


Perrin Harkins wrote:

> On Fri, 2006-01-13 at 10:44 +1100, Rick Welykochy wrote:
> 
>>In a post before Xmas someone mentioned turning off the %Live_Objects
>>mechanism in a thread about CDBI scalability and speed.
>>
>>Is this a practical thing to do? Has anyone tried?
> 
> 
> You'll never get it turned off!  NEVER!  Ha ha ha!
> 
> Or use this:
> $Class::DBI::Weaken_Is_Available = 0;

Ah ... so simple, I missed it! Thanks.

>>Also, has anyone thought about / implemented an object cache for
>>CDBI? Seems like a relatively easy thing to do.
> 
> 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.

I have written caching systems for web-based DB app before (not using
Class::DBI). Web apps are often ideal candidates for caching: usually
lots and lots of readonly data, and the data are very shortlived.

The gotchas I know involve updates to the database and keeping the
cache in sync with those changes. Often, a simple brute-force approach
if data gets out of sync is to clear the cache when data is being updated
prior to displaying results that rely on the update.


thanks,
rickw

-- 
_________________________________
Rick Welykochy || Praxis Services

Maybe this world is another planet's Hell.
      -- Aldous Huxley




More information about the ClassDBI mailing list