Dustin Sallings wrote:

> ...
> Firstly, I think there are two new commands to implement tags:
>
> 1)  add_tag (key, tag_name)
> 2)  invalidate_tag (tag_name)

Using these commands, would that mean that adding a key with tags, would require 2 commands from the client, or are there "internal" commands, and the tags would be passed as part of the set request (as discussed in previous threads on the topic)?

>> ...
Third point. I am also assuming that we can assign more than one tag to a key. If I could only add one tag to a key, then that would limit its usefulness to me. I see you mention pointers (and not just pointer) so I am sure that this is correct, just clarifying.

Absolutely.  Each item may have zero or more tags.

--
Dustin Sallings


Multiple tags per key would make them _much_ more useful for me also, but I can also see that this may be a sticking point for the implementation when adhering to the goal that memcache operations should be O(1), it was in my client-side (script, not memcache-client) implementation.

Using the algorithm you described, I think that would make a get operation O(n), because it would need to check each tag for each key to ensure it hasn't been invalidated. This could, of course, be quite significant for multi-gets with many keys. Unless there is some trick I'm unaware of (quite possible, I'm a scripter, not a C coder).

--
Brenton Alker


Reply via email to