[CDBI] Memcached

Derek Watson watson at wayspa.com
Fri Jan 26 19:18:31 GMT 2007

Comments are in-line, below

> >>>>> "Derek" == Derek Watson <watson at wayspa.com> writes:
> Derek> What is the best way to use Memcached with Class::DBI? Should I just
> Derek> override retrieve() and update()? I have reviewed Class::DBI::Sweet's
> Derek> code for implementing caching, but it doesn't seem very clean. .. is
> Derek> that just the nature of CDBI's framework or is there a better way?
> Derek> Please let me know if anyone else is using this type of functionality
> Derek> or if anyone is close enough to the internals to know the right
> Derek> approach for doing this sort of thing.

On 1/26/07, Randal L. Schwartz <merlyn at stonehenge.com> wrote:
> I've tried to do this stuff, and gotten some degree of success,

Can you share your approach and experience? Did you overload
retrieve() and update()? Did it work as expected?

> but I believe it was Perrin who told me first that if you have to cache that much, you are
> probably going to get a better return by fixing the database or your queries
> instead.  Sorry if I ruined the quote too badly, Perrin.

A) Why would you assume that database optimization and object caching
are mutually exclusive? B) Why would you assume that my database has
the ability to outperform Memcached?

Memcached is a key component in making some of the web's most heavily
trafficked sites possibe: (http://www.danga.com/memcached/users.bml)
and it alarms me that I can't find anyone using it with CDBI.
Furthermore, it's sad that 2 pillars of the Perl community would
discourage it's usage.

Frankly -- should I be looking at a different object persistence
layer, or a different development environment?


> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

More information about the ClassDBI mailing list