Redis pseudo-master-slave

Source: Internet
Author: User

As a cache server, redis has very powerful functions.

Redis also provides the master-slave mechanism. The slave synchronization time is on the testing machine (unit: MS ). In the figure, the master and slave nodes are distributed in two data centers, and the access time is around 0.88ms.

However in the http://redis.io/topics/replication there is such a sentence: When a master and a slave reconnects after the link went down, a full Resync is completed MED.

This means that if there is 10 GB Data in redis, and slave redis disconnects for any reason, slave will re-Synchronize the 10 GB Data. When slave needs to accept the read operation and the network is unstable, problems will certainly occur as the data volume increases.

To solve this problem, we re-designed the redis synchronization policy: first, store a list in redis and insert the list when there is data. Second, the local script monitoring queue is not empty, synchronize data to the Server Load balancer instance.

This design ensures that when the network between the master and slave is disconnected, you do not need to re-Synchronize all the data, but only need to synchronize the data in the list.

List Operation: http://www.cnblogs.com/stephen-liu74/archive/2012/02/14/2351859.html

CodeFollow-up

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.