[development] Object caching (was: memcache)

Steve Rude steve at achieveinternet.com
Wed Mar 7 18:18:01 UTC 2007


On 3/7/07, AjK <andy at pingv.com> wrote:
>
>
>
> > If you're talking about object caching where in 90% of the cases the
> > objects live in the database, I wonder whether this kind of caching
> > would have a better payoff than just increasing the memory caching done
> > by the DB engine (mysql,etc). It doesn't strike me as a big payoff for
> > the code that it would take too achieve.
>
> 90% may well live in the database but in a disparate way. Nodes are
> "constructed". If you have say 10 modules all adding their own unique
> goodness to the $node object via hook_load() or hook_nodeapi() then
> there's
> a lot of database queries going on during that construction process. Add
> to
> that the PHP overhead of calling all those hooks during the construction
> phase then the db layer caching starts to become minor even though still
> beneficial.
>
> If you can cache the resulting constructed object into a memcache (or
> file,
> whatever) you save yourself all that construction overhead. You can just
> quickly recover the ready assembled object from cache. Expiring the cache
> can be done in node_save() and the next node_load() reconstructs/caches
> the
> node again. Same for user and comment objects. Cache expiry when adding a
> new module (or removing one) would be needed also.
>
> But getting a cache set-up like this can have great benefits. I think
> that's
> what this thread is about, isn't it?
>
> --Andy
>
>
Exactly!

-- 

Steve Rude
Lead Web Developer

    800-618-8777phone / 858-225-0479 fax
    www.achieveinternet.com
    steve at achieveinternet.com

    Achieve Internet is a Division of
    Web Page Maintenance, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070307/a261b535/attachment.htm 


More information about the development mailing list