High-availability design and implementation of Redis read-write separation (PART I)

Source: Internet
Author: User
Tags redis

Through Redis notes (a) a small Bai Zing, Redis notes (ii) master-slave and Redis notes (c) Add a password and modify the default port after the master-slave synchronization of the three articles, we have been able to create a master-slave copy of the Redis, such as the following figure:


On this basis, we do a read-write separation, write the main library, read from the library, as follows:


This actually enables the separation of read and write, however, whether it is to start or run the process, as long as there is a redis work is not normal, even if another job is normal, the whole Redis external is not available-the master is not available, not writable, never used unreadable, so there is a single point of failure, in order to solve this problem , the following improvements have been made:


After the transformation, the main Redis and from the Redis only before the start of a clear master-slave relationship, if the start of the discovery of the master or from one is not available, then the reading and writing to the common point of Redis, in order to achieve the high availability of the runtime, the load master Redis abstracted into a When an exception is accessed Redis, the method that loads the Redis is called again so that, as long as there is an available redis during the run, Redis can provide services externally.

This is the last article, the next one to share my implementation methods.

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.