I know how data is (in theory) stored in a DHT. However, I am uncertain as to how one might go about updating a piece of data associated with a key. Is this possible? Also, how are conflicts handled in a DHT.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A DHT simply defines
put(key,value)andget(key)operations and the core of the various DHT algorithms revolve around how to locate the nodes responsible for a specific key.What those nodes do on an incoming
putrequest for a value already stored largely depends on the purpose and implementation of the DHT network, not on the algorithm itself.E.g. a node might opt to timestamp all incoming values and return lists with multiple separate timestamped issues. Or it might return lists that also include the source address for each value. Or they might just overwrite the stored value.
If you have some relation between the key and a signature within the value or the source ID or something like that you can put enough intelligence into the nodes to verify the data cryptographically and thus allow them to keep a single canonical value for each key by replacing the old data.
In the case of bittorrent’s DHT you wouldn’t want that. Many different bittorrent peers announce their presence to a single key from different source addresses. Therefore the nodes actually store unique
<key,IP,port>tuples where<IP,port>can be considered the value. Which means it’ll return lists of IPs and ports on each lookup. And since a DHT will have multiple nodes responsible for one key you will actually have K (bucket size) nodes responding with varying lists.TL;DR: It’s implementation-dependent