tag:blogger.com,1999:blog-8898949683610477251.post-67117913407935485322008-01-03T20:37:00.000Z2008-01-03T20:37:00.000ZHi. Do you have any clue of how to create an algor...Hi. Do you have any clue of how to create an algorithm which tracks the history of joins/leves of members and delivers the same node for the same key if it previously looked it up. Perhaps I'm explaining this in bad terms but something like a (in memory or persistent) database in cojunction with a consistent hash.<BR/><BR/>perhaps:<BR/>public Address getAddress(key)<BR/>{<BR/>if(lookedUpMap.containsKey(key))<BR/>{<BR/> return (Address)lookedUpMap.get(key)<BR/>}<BR/>else<BR/>{<BR/> Address a = get(key);<BR/> lookedUpMap.put(key, a);<BR/> return a;<BR/>}<BR/>}<BR/><BR/>Then it is up to the client to check if the previously stored node is reachable at this very moment.<BR/><BR/>An extension to this cache would be to return a Set which size is equal to the nr of replicas of each key/value.<BR/><BR/>If a value is stored on two or more nodes then the possibilty for that at least one of the servers is up increases a lot. I'm building a distributed storage solution and the data cannnot be lost just because the cache "recalculates" the hash :)<BR/><BR/>Ahhh enough already I will implement something like this :)marcusherouhttp://www.blogger.com/profile/04583770009623026697noreply@blogger.com