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