What happens to data when a node dies in a DHT?

2019-07-23 09:07发布

问题:

Question Taken from here: https://groups.google.com/forum/#!topic/byu-cs-460-computer-networking/hpESI0NapmY

"I was thinking about how Distributed Hash Tables store data. I understand that each node is given an identifier and that the data is then stored on the node whose identifier is the closest successor to its (the data's) hash value. I also understand that when nodes join or leave the network, the data gets transferred to reflect the new set of nodes present in the network.

What I don't understand is what happens when a node dies before it can hand off its data. Is that data lost? Maybe my real question is: how can data be guaranteed not to be lost in a DHT?"

回答1:

A DHT in general is just an distributed algorithm. Specific implementations deal differently with node failures.

Put requests generally are done with some level of redundancy. Additionally the target nodes may replicate data among themselves or the originating node may periodically refresh the stored data.

In a fully decentralized p2p environment where you have no control over individual nodes you cannot really guarantee that data stays in the network forever by itself. Although on a sufficiently stable network lifetimes measured in days can probably be achieved.

In p2p networks DHTs are usually just used for discovery and metadata publication.

I.e. if Node A wants to find Node B then it'll query the DHT and in the lookup process visit a bunch of 3rd party nodes that have no direct interest in A or B.

Once discovery is done the "heavy lifting" is done by a direct peer-peer connection between A and B.



标签: cloud p2p dht