MySql Key Notes
Mysql Replication Methods:
MySQL 5.7 supports different methods of replication.
The traditional method is based on replicating
events from the source's binary log, and requires the log files and positions in them to be
synchronized between source and replica.
The newer method based on global transaction identifiers
(GTIDs) is transactional and therefore does not require working with log files or positions within
these files, which greatly simplifies many common replication tasks. Replication using GTIDs
guarantees consistency between source and replica as long as all transactions committed on the source
have also been applied on the replica.
Replication in MySQL supports different types of synchronization
(Syncronization, SemiSyncronization and asynchronization)
The original type of synchronization is one-way, asynchronous replication, in which one server acts
as the source, while one or more other servers act as replicas. This is in contrast to the
synchronous replication which is a characteristic of NDB Cluster (see MySQL NDB Cluster 7.5 and NDB
Cluster 7.6).
In MySQL 5.7, semisynchronous replication is supported in addition to the built-in asynchronous
replication. With semisynchronous replication, a commit performed on the source blocks before
returning to the session that performed the transaction until at least one replica acknowledges that
it has received and logged the events for the transaction;
Replication Format:
There are two core types of replication format, Statement Based Replication (SBR), which replicates
entire SQL statements,
and Row Based Replication (RBR), which replicates only the changed rows. You
can also use a third variety, Mixed Based Replication (MBR). For more information on the different
replication formats, see Section 5.1, “Replication Formats”.
When using statement-based binary logging, the source writes SQL statements to the binary log. Replication of the source to the replica works by executing the SQL statements on the replica. This is called statement-based replication (which can be abbreviated as SBR), which corresponds to the MySQL statement-based binary logging format.
When using row-based logging, the source writes events to the binary log that indicate how individual table rows are changed. Replication of the source to the replica works by copying the events representing the changes to the table rows to the replica. This is called row-based replication (which can be abbreviated as RBR).
You can also configure MySQL to use a mix of both statement-based and row-based logging, depending on which is most appropriate for the change to be logged. This is called mixed-format logging. When using mixed-format logging, a statement-based log is used by default. Depending on certain statements, and also the storage engine being used, the log is automatically switched to row-based in particular cases. Replication using the mixed format is referred to as mixed-based replication or mixed-format replication. For more information, see Mixed Binary Logging Format.
Comments
Post a Comment