invalidation by namespace Re: Listing all keys on a server: why?
jedgecombe at carolina.rr.com
Sat Jul 29 00:22:20 UTC 2006
Martin Atkins wrote:
> Serhat Sakarya wrote:
>> On 7/28/06, Paul T <pault12345 at yahoo.com> wrote:
>>> 3. key_salt is stored in memcached forever.
>> The problem I see with this approach is that when the salt *does* get
>> (node reboot, failure, etc), you risk that old data may be revalidated.
> This is a very good point. What if the revision counter expires before
> the data?
> It does mean that whichever node the revision counter is on becomes a
> single point of failure for that namespace, too. If that node goes
> down you've lost the entire namespace until it comes back up again, at
> which point you're worse off because your counter goes back to zero.
> The only solution that springs readily to mind is to treat the
> revision counter like any other cached value and store it in
> persistent storage as well as in memcache. That way you can restore it
> should it be lost. In normal circumstances, this becomes a performance
> hit only when invalidating a revision.
What if you use md5, sha1 or some other generated salt? If and only if
the salt is changed when the data is changed, then this should work. You
could still cache the salt, but it would always change when the data
If the salt expires, it could just be regenerated. If the salt expires
before the data, the data will still be used if it's valid and there is
less chance of re-validating old data.
More information about the memcached