MySQL semi-synchronous replication practices

Source: Internet
Author: User

MySQL semi-synchronous replication practices

Semi-synchronous Replication
MySQL master-slave replication only supports asynchronous replication before MySQL 5.5. That is to say, after the master database executes some transactions, no matter the progress of the slave database, the biggest advantage of this method is fast speed and high efficiency. The disadvantage is that the data consistency between the slave database and the master database cannot be ensured after the master database is down.

The advantage of semi-synchronous replication is that after each transaction is executed, the master database will wait for the slave database to accept the log before returning it to the client. If a small transaction is performed, if the latency of the two hosts is small, zero data loss can be ensured when the performance is low.

Principle

1) each time the master database executes a transaction, the slave database reads the log first to ensure that at least one slave database has the complete data
2) If the master database still does not receive a response from the slave database within a timeout period, the system automatically switches q back to the asynchronous mode to ensure business operation.
3) semi-synchronous replication can only ensure that logs are read from the slave database, and data cannot be written to the slave database. You must also check the execution of the slave Database SQL process.
4) if a slave database catches up with the master database, the mode continues to switch back to the semi-sync status.

Environment Construction practices
The MySQL semi-synchronous replication plug-in is provided by Google. It can be directly used after MySQL 5.5.
!! Note that the master-slave replication must be implemented before the two hosts implement semi-synchronous replication.
Refer to blog:

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.