Reprint please indicate source: http://blog.csdn.net/cywosp/article/details/23397179A distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. The consistency hash
Foreword: For the consistency hash is not a rare concept, this is only a collation of the original theory and with their own understanding of the story, I hope that the novice has a little help, the benefit of self-interest is sufficient.1. ConceptA consistent hash is a special hashing algorithm. After using a consistent hashing algorithm, the change in the number of slot bits (size) of the hash table only
added later more active. Obviously, the hash algorithm above cannot do the same.
Is there any way to change this situation? This is consistent hashing...
2 hashAlgorithm and Monotonicity
A metric of the Hash algorithm is Monotonicity, which is defined as follows:
Monotonicity means that if some content is already allocated to the corresponding buffer through hash, new buffering is added to the system. The hash result should ensure that the original a
First, create a background
Today I do not go to the long-winded special detailed explanation consistent hash, I strive to use the most relaxed way to tell you consistent hash algorithm is what, if need to go deeper, Google a bit ~.
Give me a chestnut:
For example, there are n cache servers, you need to map an object to n cache, we can calculate the hash value of object in a similar way, and then map evenly
there any way to change this situation, this is consistent hashing ...
2 Hash Algorithms and Monotonicity
One metric of the Hash algorithm is monotonicity (monotonicity), defined as follows:
Monotonicity is the addition of new buffers to the system if some content has been allocated to the corresponding buffer by hashing. The result of the hash should be that the original allocated content can be mapped to the new buffer without being mapped to ot
The consistent hashing algorithm was first published in 1997.
Consistent hashing and random treesHas been proposed, and is widely used in the cache system. 1 basic scenario
For example, if you have n cache servers (hereinafter referred to as cache), how can you map an object to N caches, you may calculate the object's hash value using a method similar to the following, and then map it evenly to N caches.
Ha
The consistent hashing algorithm was proposed in the paper consistent hashing and random trees as early as 1997. It is widely used in cache systems;
1. Basic scenariosFor example, if you have n cache servers (hereinafter referred to as cache), how can you map an object to N caches, you are likely to use a method similar to the following to calculate the object's hash value, and then uniformly map it to N ca
This article goes from: http://blog.csdn.net/cywosp/article/details/23397179 consistent hashing algorithm, a distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, Designed to address hot spot problems in the Internet, the original intention and carp are very similar. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing
One: HashMap before talking about consistent hashing, first review hashmap. When using HashMap, the key is mapped evenly into the HashMap internal array (Entry ""), and the mapping method uses the hash value of key to do the shift operation. And the length of the entry array (Length-1) is done with operations (unlike Hashtable, (Key.hashcode () 0x7FFFFFFF)% Table.length, which makes the data distributed evenly).When the put operation, when the amount
The first time with consistent hash (hereinafter referred to CH) is in the network principle of a book, he applied in the Peer-to-peer network, mainly solves the problem of distributing storage resources. At that time is not very clear his scope of application and Chinese name, PS network principle of a book is in English, of course, also did not appear ch words.
The second meeting is in the use of memcache, under the guidance of high man with CH to a
Reprint please indicate source: http://blog.csdn.net/cywosp/article/details/23397179A distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment.The consistency hash al
reprint Please indicate source: http://blog.csdn.net/cywosp/article/details/23397179a distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp.The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. The consistency hash al
Reprint please indicate the source: http://blog.csdn.net/cywosp/article/details/23397179 a distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, Designed to address hot spot problems in the Internet, the original intention and carp are very similar. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. T
Turn from: http://blog.csdn.net/cywosp/article/details/23397179 a distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, Designed to address hot spot problems in the Internet, the original intention and carp are very similar. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. The consistency hash algor
First, create a backgroundToday I do not go to the long-winded special detailed explanation consistent hash, I strive to use the most relaxed way to tell you consistent hash algorithm is what, if need to go deeper, Google a bit ~.Give me a chestnut:For example, there are n cache servers, you need to map an object to n cache, we can calculate the hash value of object in a similar way, and then map evenly to
Please indicate source: http://blog.csdn.net/cywosp/article/details/23397179A distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. The consistency hash algorith
A distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment. The consistency hash algorithm proposes four definitions for determining the good or bad hash algorithm i
A distributed hash (DHT) implementation algorithm, proposed by MIT in 1997, was designed to address hot spot problems in the Internet, with a similar intent to carp. The consistent hash corrects the problem caused by the simple hashing algorithm used by carp, so that distributed hashing (DHT) can be really applied in the peer-to-peer environment.The consistency hash algorithm proposes four definitions for determining the good or bad hash algorithm in
The consistency hash can be is used to solve the server balancing problem. With Golang simple implementation of the next, and added the weight. Suitable weights can be used with the algorithm.Package main//Consistency Hash (consistent Hashing)//author:xiong Chuan liang//date:2015-2-20import ("FMT" "Hash/crc32" "Sort" " StrConv "" Sync ") const DEFAULT_REPLICAS = 160type hashring []uint32func (c hashring) len () int {return Len (c)}func (c Hashri NG) L
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.