Consistency hash Algorithm application scenario, elaboration and implementation (JAVA)

Source: Internet
Author: User

I. Overview

In a distributed environment, developers often encounter a number of distributed storage scenarios, such as database sub-Library sub-table (such as the user ID tail number 1 into the database 1,id tail number to 2 into the database 2), and such as the acquisition of distributed cache data (such as the distribution of cached data based on IP address storage). In this case, how to quickly put the data into the specified location, and how fast access is the most basic requirements, for this implementation, there are the following two common ways:

1, Configuration Center Pull: In this case, the data is routed through this central node pull-up configuration, in the following way:

The advantages and disadvantages of this model are obvious, the advantage is easy to maintain, the back of the elastic expansion will only need to operate the configuration center data, can do the dynamic completion of the expansion of the DB and other problems. The disadvantage is that in the case of configuration center in the event of a problem, the consequences are catastrophic, easy to have a single point of failure, and when the subsequent data volume is particularly large, the configuration center may itself become the bottleneck of the system.

2, for the need to operate data, through a certain rule to generate a key, and then according to the key to perform a certain rule operation, directly get to the specific data operation address. Some of the algorithms described in this article are implemented in this way.

Consistency hash Algorithm application scenario, elaboration and implementation (JAVA)

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.