Delete Objects based on REGEX.
Steven Grimm
sgrimm at facebook.com
Thu Jul 26 08:02:09 UTC 2007
I actually implemented regex deletes quite some time back. But the
problem is that I did it in a brute-force way, nothing elegant or
efficient, and if you have a large cache the whole thing will freeze up
for many seconds, chewing 100% of your CPU while the code walks through
all the items comparing them against the regex. We wanted it for very
occasional administrative operations where the cache freezing up for a
short while would be less disruptive than a full flush, but I think
we've used it maybe two or three times at most because it's so nasty.
Brad's generation-based idea makes much more sense as a long-term
approach to this feature, but honestly I like tags a lot better. I'd
rate tags a 10 and regex deletes, even well-implemented ones, at most a
6 or 7 because they're so inflexible and require that all consumers of
objects in the cache be aware of all the metadata you can use to address
a particular object (because it's all part of the key and you need the
whole key to query the cache.) Tags are IMO far superior because you can
tag an item with metadata that some of your clients are blissfully
unaware of.
-Steve
BUSTARRET, Jean-francois wrote:
> IMHO, regexp deletes would be great. I would prefer tags, but on a scale of 10 (0 being the current state), tags would be at 10, and regexps at 9.
>
> I my case, it would solve the most important cache coherency problems.
>
> I'm willing to help (I would be unable to code the most complex part of it, but still willing to help).
>
>
>> -----Message d'origine-----
>> De : memcached-bounces at lists.danga.com
>> [mailto:memcached-bounces at lists.danga.com] De la part de
>> Dustin Sallings
>> Envoyé : mercredi 25 juillet 2007 23:14
>> À : dormando
>> Cc : P R E M; memcached at lists.danga.com
>> Objet : Re: Delete Objects based on REGEX.
>>
>>
>> On Jul 25, 2007, at 12:59 , dormando wrote:
>>
>>
>>> Seems interesting, don't recall if anyone was specifically
>>>
>> against it.
>>
>>> The implementation details are a bit foggy, and someone has
>>>
>> to go do
>>
>>> it still.
>>>
>> The biggest complaints are that people feel that it may
>> not solve actual problems people have. The alternative is
>> tags, but that seems more complicated (to use) to me.
>>
>> In the end, if nobody's problems are solved, people
>> probably aren't going to be writing any code for it.
>>
>> --
>> Dustin Sallings
>>
>>
>>
>>
More information about the memcached
mailing list