Distributed Hash table

Source: Internet
Author: User

1. Concept
A Distributed Hash table (DHT) is a class of a decentralized distributed system that provides a Lookup service similar to a hash table. (Key,Value) Pairs are stored in a DHT, and any participant ipating node can efficiently retrieve the value associated
With a given key.
Two points:
1) Distributed Environment
2) hash table
For a key/value pair, DHT provides services like hashtable in a distributed cluster, such as simple and quick access and query.

See (from wiki ):
2. DHT features
DHT is not an algorithm, not an implementation, but a concept. Its features can be summarized as follows:
Decentralization: the nodes collectively form the system without any central coordination.
Fault Tolerance: The system shocould be reliable (in some sense) Even with nodes continuously joining, leaving, and failing.
Scalability: The system shocould function efficiently even with thousands or millions of nodes.

3. Consistent Hash (Consistent hashing)
Consistent hash is a special DHT, which is defined as follows:
"Consistent hashing is a scheme that provides hash table functionality in a way that the addition or removal of one slot does not significantly change the mapping of keys to slots"
That is, consistent hash does not cause major changes in the ing relationship when the node is added/left.
The implementation of consistent hash is as follows:

  • Assuming that the hash key is evenly distributed in a ring
  • All nodes are also distributed in the same ring.
  • Each node is only responsible for a part of the key. When a node joins or exits, only a small number of keys are affected for the nodes that join and exit, as well as their neighbor nodes, or other nodes.

4. DHT implementation
DHT has many implementations, including:

  • Chord
  • Kademlia
  • Pastry
  • Can
  • P-grid
  • BitTorrent DHT
  • Apache cassandra
  • Tapestry

5. Chord
Chord is a typical Implementation of DHT (or consistent hashing) (DHT in Cassandra can be regarded as a simplified version of chord). There are many articles describing the Chord algorithm (see references)
The following briefly describes the chord structure:
Chord maps nodes (storage and query nodes) and keys to the same space for consistent hash. Assign a unique ID for each node in the network (which can be hashed by the MAC address of the machine). If there are n nodes in the network, we can consider these Integers to be connected at the beginning and end to form a ring, it is called the chord ring. The distance between two nodes is defined as the subscript difference between nodes. Each node stores a route table (finger table), which is clockwise 2, 4, 8, 16, and 32 from the current node. ...... 2I distance from the selected log2n other node IP information to record.

6. Summary
Dhts form an infrastructure that can be used to build more complex services, such asanycast, cooperative Web caching, distributed file systems, domain name services, instant messaging, multicast, and also peer-to-peer
File Sharing and Content Distribution Systems
Refer:

Http://en.wikipedia.org/wiki/Distributed_hash_table

Http://blog.csdn.net/sparkliang/article/details/5279393

Http://blog.csdn.net/chen77716/article/details/6059575

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.