我最近我一直在使用memcached,并且我确定你正在尝试使用依赖关系对于memcached来说“按原样”是不可能的,但是需要从客户端进行处理。此外,数据复制应该发生在服务器端而不是客户端,这些是两个不同的域。 (至少在memcached中,看到它缺乏数据存储逻辑,memcached的重点在于极端的极简主义性能)
对于数据复制(针对物理故障集群节点的保护),您应该签出代替http://www.couchbase.org/get/couchbase/current。
对于deps算法,我可以在客户端看到类似这样的内容:对于任何给定的键,都有一个可疑的附加键,其中包含相关键的列表/数组。
# - delete a key, recursive:
function deleteKey(keyname):
deps = client.getDeps(keyname) #
foreach (deps as dep):
deleteKey(dep)
memcached.delete(dep)
endeach
memcached.delete(keyname)
endfunction
# return the list of keynames or an empty list if the key doesnt exist
function client.getDeps(keyname):
return memcached.get(key_name + "_deps") or array()
endfunction
# Key "demokey1" and its counterpart "demokey1_deps". In the list of keys stored in
# "demokey1_deps" there is "demokey2" and "demokey3".
deleteKey("demokey1");
# this would first perform a memcached get on "demokey1_deps" then with the
# value returned as a list of keys ("demokey2" and "demokey3") run deleteKey()
# on each of them.
干杯