mass deletions

Martin Atkins mart at degeneration.co.uk
Sat Sep 2 19:58:43 UTC 2006


matt DiMeo wrote:
> It occurred to me this morning that it might be useful to be able to delete classes of data en masse.
> 
> Since keys are often formatted as datatype:id, it'd be a handy feature to be able to mass-delete everything with a prefix of "datatype:".  Alternately, specify a (numeric?) class of data at insert time, and mass-delete using that class.
> 

I'm afraid you've stumbled apon a "frequently requested feature!"

This has been discussed before, and while there's agreement on the fact 
that it'd be useful there are a few different approaches to implementing 
it, all with disadvantages.

However, there is an approach that you can implement yourself:
     <http://article.gmane.org/gmane.comp.web.cache.memcached/1125>

Like all of the solutions, this has caveats. The most important one 
being that if you lose a cache node you can lose that revision counter 
and end up starting again from zero, potentially hitting stale data.

The suggested workaround for this is to keep your revision counters in 
persistent storage in addition to the cache, which is in normal 
circumstances a performance hit when invalidating a revision (ie 
deleting) but makes no difference for sets and gets.

Cheers,
Martin



More information about the memcached mailing list