Redis High-availability evolution

Source: Internet
Author: User

Recently collated Redis, a deeper understanding of Sentinel, specifically summarized as follows

1. master-Slave Redis

Master-Slave Redis is actually a primary standby mode that allows you to switch from Redis to service after the master Redis outage.

Disadvantages:

1. People pay attention to whether Master is down

2. Unable to complete auto switch master/slave

3. The function of the slave node is not fully utilized

Master-Slave Mode:

2.sentinel

To address this determination, Redis officially provides Sentinel to ensure high availability of Redis

Figure 1 shows the relationship between Sentinel and Redis, where the Sentinel system creates two links for each Redis instance (master, slave): Command connection, subscription connection

Command connection: Send info command to keep communication with Redis

Subscribe to connections: Automatically discover other Sentinel instances by subscribing to a connection

Figure 2 shows a minimal sentinel, which is comprised of at least three sentinel instances, and when the monitored Redis is judged to be the supervisor downline, it is necessary to elect a minor sentinel from Sentinel for master-slave switchover.

Advantages:

1.SENTIENL can monitor the health status of master-slave node, reduce the cost of human monitoring

2.sentinel can complete master-slave switching

Disadvantages:

1. From the node is still not fully utilized

2. Unable to scale out, only one master of the server is available

Sentinel Mode:

Figure 1

      

Figure 2

3. sharding

The idea of sharding is to achieve the scale-out of Redis by using the consistent hashing algorithm.

1. Storage of Sentinel configuration information via zookeeper

2. Implement a consistent hashing algorithm on the client, which determines that the Redis command is executed by the Redis instance through the routing algorithm

3. To share the pressure of a single shard by increasing shard

Disadvantages:

1. Data migration is involved in the expansion, if the Redis is only cached data is easy to handle, but if there is a strong reliance on Redis business data, the migration can only stop processing

2. Unable to solve hot and cold data problems

Shard Mode:

The following sections focus on:

Jedisclient the implementation principle of the customer list

Redis High-availability evolution

Related Article

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.