groups of keys and dependent keys

Martin Kihlgren zond at troja.ath.cx
Mon Oct 16 16:49:43 UTC 2006


Hello list.

My name is Martin Kihlgren, and I am currently employed by a company
that heavily relies on memcached.

We are doing lots of caching, simply.

And, unfortunately, a whole lot of invalidations.

Today we got to know of
http://search.cpan.org/dist/Cache-Memcached-Managed/lib/Cache/Memcached/Managed.pm#SYNOPSIS
and I thought about the implications.

It would be so very much nicer to have this functionality built into
memcached :O

The scheme I would imagine is:

 * The addition of key dependency, in at least one level.
   * A key can be declared depending on another key.
 * A key can not be dropped unless all keys depending on it are
   dropped.
   * If a key having dependent keys MUST be dropped, the whole
     set of dependent keys are dropped as well.

This would make it very easy for us to create group keys having
dependent keys, and then just delete the group key thus forcing all
dependent keys to be dropped.

Much simpler and more efficient than storing the set of keys in the
group in memcache (thus having to worry about memcache dropping the
group key before the individual keys in the group are dropped) and
also much better than storing the group keys on disk or in db.

Is this something you have discussed? Or is it already in some edge
version of memcached? Or is it something that is possible to do with
the current codebase?

regards,
//Martin Kihlgren

-- 
###################################################################
An old man at the Folies Bergere
Had a jock, a most wondrous affair:
	It snipped off a twat-curl
	From each new chorus girl,
And he had a wig made of the hair.
###################################################################


More information about the memcached mailing list