Thanks for the pointers on where I need to get up to speed!<br><br>In terms of what I mean by a "global object caching strategy," ideally that means the same code, but at a minimum parallel APIs or methods. Most importantly it should be easy for savvy developers to follow "the Drupal way." <br>
<br>Ultimately this is a design pattern thing, where we stop thinking of everything as necessarily coming from a database, and start thinking in terms of using the database as a highly efficient method for pulling up lists of IDs, and then loading the objects that are germane. My initial thoughts are here:<br>
<br><a href="http://groups.drupal.org/node/19385">http://groups.drupal.org/node/19385</a><br><br>Without object caching this is potentially expensive: think of the difference between a simple view built around specific fields vs one that calls node_load() for each resulting item. However, once you've got your nodes in a memory cloud, it's actually quite a lot faster. <br>
<br>Moreover, this follows emerging best-practices for high availablility and scalability. E.g.:<br><br><a href="http://dev.mysql.com/doc/refman/5.1/en/ha-memcached.html">http://dev.mysql.com/doc/refman/5.1/en/ha-memcached.html</a><br>
<br>As memcached becomes a commodity service -- e.g. it's trivial to roll out with the latest Debian and CentOS releases -- the upside of having the community put collective brainpower into the best way to utilize these tools (abd bake support into core) is huge. <br>
<br>cheers<br>-josh<br><br><div class="gmail_quote">On Sun, Feb 22, 2009 at 12:29 PM, Nathaniel Catchpole <span dir="ltr"><<a href="mailto:catch56@googlemail.com">catch56@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
There's a patch for node_load() here - <a href="http://drupal.org/node/111127" target="_blank">http://drupal.org/node/111127</a> - has been sitting at RTBC for weeks though and just gone stale again.<br><br>Since terms, users (hopefully, soon) etc. have almost exactly the same code for loading now, it'd be easy to add the same pattern there too, and I was thinking about trying that if node_load() gets in.<br>
<br>The new core field API also allows objects to declare themselves as already cached - so the field cache is skipped for those objects and we save filling up memcache bins with the same stuff, so no issues there.<br><br>
However I'm not sure what you mean by a global object caching strategy - actually the same code? Or just parallel APIs? Nedjo Rogers has a patch for the former at <a href="http://drupal.org/node/365899" target="_blank">http://drupal.org/node/365899</a> - adding cache_set/get to it wouldn't be hard at all (at least when loading by IDs, which is all we need really). Although I'd be tempted to add the caching in separate patches then unify it all later rather than trying to do both at once.<br>
<br>+1, anyway.<br><br>Nat<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>
<br>
<br>
Josh Koenig wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Greetings,<br>
<br>
I'd like to take the community's temperature on developing a global object caching strategy for drupal core 7.0. In effect, this would mean pulling the functionality of advcache module into core, though the code would doubtless be a bit different.<br>
<br>
This has been previously discussed by Robert Douglass and Steve Rude, and I think both the short-term and strategic value here is clear. As memcached permeates the collective consciousness of the web-development community, and as "cloud" computing becomes more and more prevalent, best practices in architecture increasingly point towards caching full objects whenever possible.<br>
<br>
This also fits well with Drupal's existing architecture. There are great functional points (e.g. node_load()) to mount this functionality.<br>
<br>
I'm certain I'm not the only one thinking along these lines. Anyone want to throw out their ideas?<br>
<br>
cheers<br>
-josh<br>
<br>
</blockquote>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>--------------------<br>Josh Koenig, Partner & CTO<br><a href="http://www.chapterthree.com">http://www.chapterthree.com</a><br>