How to replicate data with memcache
I am trying to find good resources on best practices to data replication across memcache servers. What I want to accomplish is that if one of my servers in my pool goes down, the next server in line already has the info set.
I have found "repcached" but since I run a WIN32 test environment, I have been unable to install it.
So what's our alternatives on how to replicate data between server开发者_如何学Pythons?
Thanks,
I've never bothered with this myself (memcache is just meant to be a cache after all, even if each instance was an exact copy of every other instance, you still can't guarantee that a value will always exist once you add it: it might be evicted due to the LRU policy, for example).
However, if I were to implement this as a feature, I would put it in the client and not as a patch to the server.
That is, instead of hashing a key to a single server, hash it to 2 or 3 servers and store the value on all of them. Then, when getting the value back again, try to get it from the first, if it's not there, try the second one and so on.
This has the added benefit of not replicating every value: you can replicate only those that you choose to.
精彩评论