Processing obsolete data with memcached / sequential hashing

Suppose that I have two memcached nodes ( node A, B ) at the beginning, and when I add a new node C , part of the keys are reassigned and, thanks to serial hashing, only some of them.

Assume that the value with the key " foo " initially on server A is now mapped to server C.

When I finally delete node C, the key should again display on node A, but at that time node A contains only outdated data.

So, is data cleansing the only way to solve this problem?

+6
source share
2 answers

I think the only thing you need to do with outdated data is ... nothing! you know that if you introduce a new server, part of the cache will be invalidated. all this! let memcached to get rid of outdated data for you when this moment comes!

Another thing is that you cannot get rid of obsolete objects yourself, because you do not know which server stores this object (thanks to the agreed hash algorithm).

I hope to answer your question.

+2
source

Your problem is that "the data in your cache is out of date"; so how to fix it?

So you need to update the cache with the most recent value . I do not think there is an alternative to this. You can consider different optimization approaches depending on the requirements of your system.

+2
source

All Articles