MySQL master-slave replication principle --- talking about mysql master-slave

Source: Internet
Author: User

MySQL master-slave replication principle --- talking about mysql master-slave

Learning and learning make me happy !!

The built-in replication function of MySQL is the basis for building large and high-performance applications. Distribute MySQL Data to multiple systems. This Distributed Mechanism copies data from one MySQL host to another Server Load balancer, and execute the code again.

During the replication process, one server acts as the master server, and one or more other servers act as slave servers. The master server writes updates to binary log files and maintains an index of the files to track log loops. These logs can record updates sent to the slave server. When an slave server is connected to the master server, it notifies the master server of the last successful update location read from the server in the log. The slave server receives any updates from that time, blocks them, and waits for the master server to notify you of updates.

Note that all updates to the copied table must be performed on the master server. Otherwise, you must be careful to avoid conflicts between updates to tables on the master server and those on the slave server.

MySQL supports the following replication types:

(1) Statement-based replication: the SQL statement executed on the server and the same statement executed on the slave server. MySQL uses statement-based replication by default, which is more efficient.

(2) Row-based replication: Copies the changed content instead of running the command on the slave server. Supported since MySQL5.0.

(3) hybrid replication: Statement-based replication is used by default. If statement-based replication fails, row-based replication is used.

MySQL replication technology has the following features:

(1) Data Distribution

(2) Load Balancing

(3) backup

(4) backup availability and fault tolerance

Simple original description ------ I wrote the specific setup steps in the previous 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.