Which way is better for running memcached?

Russ Garrett russ at last.fm
Fri Feb 16 17:52:38 UTC 2007

On 16 Feb 2007, at 17:05, Steven Grimm wrote:
> We use it a lot. We divide the data for a given page into "stuff we  
> need immediately for the business logic that will change what other  
> data we need to fetch," "stuff we need for the business logic that  
> we can evaluate in isolation," and "stuff we're going to display."  
> The first gets fetched as needed during the execution of the page.  
> The second and third, we queue up internally and request all in one  
> big "get" just before rendering the page at the end of the request;  
> for the second class of data, we have a callback mechanism wrapped  
> around the memcached client so that we can run our business logic  
> using some of the returned data. There are some additional wrinkles  
> but that's the rough idea.
> By the way, it's not really any easier or harder in PHP than in any  
> other language; it's about application structure, not language. If  
> we were writing our site in Java or Python or C/C++ we'd probably  
> do exactly the same thing.

Yeah, true. But it does seem tricky with conventional coding patterns.

...although now I think of it, we could do this by pre-loading lists  
of objects before we pass them to the template. Food for thought,  
thanks :)


Russ Garrett
Last.fm Ltd.
russ at last.fm

More information about the memcached mailing list