How replication works
The following diagram shows how the replication process works:
A little explanation makes it easier to understand the process:
- A client requests a write transaction on the master host.
- The binary logs (also called binlogs) are updated. The binary logs contain events that describe database changes.
- The slave receives the information from the master.
- It then appends it to its relay logs.
- The slave SQL thread replays the statements contained in the relay logs.
There are 2 kinds of replication mechanisms:
- Standard replication: This is the most common method, standard, each node has its own transaction ID
- Global Transaction ID (GTID) replication: GTID permits each node to have the same transaction ID on all replicated nodes (only available from MariaDB 10)
We will see both the mechanisms and understand the advantages of GTID. In both the cases, when a network cut occurs, it is able to automatically reconnect and resume the replication (depending on the retention days).
Now, since...