You wouldn't be able to delete all keys tagged "xxx_whiffelbat_abc". You would only be able to delete all keys tagged "whifflebat". If you need to be able to delete all keys related to whifflebat, you need to tag them with it.

So yes, it does require a bit more planning. But since tagging a key scales you can merrily tag away.


How do tags help when a developer runs over, saying something about expiring all keys with the word 'whifflebat' in the middle?

Or, I guess, is the idea of tagging more about not using key prefixing at all anymore? That'd be swell, but I think that would be the two camps of thought here.

Tags) Requires planning
Regex) Pragmatism

Maybe there's a way to do both without duplicating tons of code? :)

-Dormando

Steven Grimm wrote:
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



------------------------------

_______________________________________________
memcached mailing list
[email protected]
http://lists.danga.com/mailman/listinfo/memcached


End of memcached Digest, Vol 36, Issue 55
*****************************************

--
Geschäftsführer / Managing Director
Hitflip Media Trading GmbH
Gürzenichstr. 7, 50667 Köln
www.hitflip.de - new: www.hitflip.co.uk

Tel. +49-(0)221-272407-27
Fax. 0221-272407-22 (that's so 1990s)
HRB 59046, Amtsgericht Köln

Geschäftsführer: Andre Alpar, Jan Miczaika, Gerald Schönbucher

Reply via email to