namespaced keys

Bug #649802 reported by Tarek Ziadé
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Python Memcached
Incomplete
Wishlist
Tarek Ziadé

Bug Description

On the Danga website, they are describing a way to group keys under the same namespace, with a way to invalidate all those key on a single operation by defining a unique value like time() for the namespace.

>>> cache.set('the_namespace', time.time())
>>> key = cache.get('the_namespace') + ':key1'
>>> cache.set(key1, 'value1')
>>> key2 = cache.get('the_namespace') + ':key2'
>>> cache.set(key2, 'value1')

To invalidate all keys, we just have to increment the namespace key:

>>> cache,incr('the_namespace')

The keys will automatically change when they are calculated, thus invalidating all existing values (which can naturally expire then.)

It could be interesting to add that feature in python-memcached for people that need to group cached values.

Revision history for this message
Sean Reifschneider (jafo) wrote :

This is a great idea, if someone implements it I'll include it.

Changed in python-memcached:
importance: Undecided → Wishlist
status: New → Incomplete
Changed in python-memcached:
assignee: nobody → Tarek Ziadé (tziade)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.