High performance MySQL Chapter 10th copy

Source: Internet
Author: User

Replication capabilities not only build highly available applications, but are also the basis for high availability, scalability, disaster recovery, backup, and data warehousing.

MySQL supports two ways of replicating: statement-based replication and row-based replication. Statement-based replication (also logical replication) is a feature provided by earlier versions, and row-based replication was added to version 5.1. Both of these methods enable asynchronous data replication by recording binary logs on the main library and replaying logs from the library. This means that at the same time, the data from the main library and from the library may be inconsistent. And there is no guarantee of delay between master and slave. Some large statements can result in a delay of a few seconds, a few minutes, or even a few hours between master and slave.

Replication typically does not increase the cost of the main library. This is primarily the overhead of starting a binary log. However, this overhead is necessary for backup, but for backup purposes or even recovery from crashes. ( personal Understanding: This should be the transaction log, the binary log and the transaction log should be a thing ). In addition, each slave library reads logs from the main library, which increases the network IO overhead of the main library.

Statement-based replication is the fact that SQL statements are replayed from the library, row-based replication, to record those rows on the main library are modified, and then do the corresponding operations from the library.

MySQL does not support a library with multiple main libraries.

The library can be used not only as a library to share reading pressure. It can also be used as a library for full-text retrieval. Because MySQL natively supports full-text indexing, only under the MyISAM storage engine, full-text indexing is supported, so you can set the storage engine from the library to MyISAM and then retrieve the full text from the library.

It is best to tolerate replication delays in the early stages of the design, and if the data from the library is delayed, it may not work well, and the application might not use replication.

The methods and details of configuring master-slave replication are not studied for the time being.

High performance MySQL Chapter 10th copy

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.