Home > Back-end >  Why there have two ways to update `Binary log`.(1. Master Binlog dump 2. Master Database)
Why there have two ways to update `Binary log`.(1. Master Binlog dump 2. Master Database)

Time:10-13

I see a snapshot in enter image description here

I have a question about why there have two ways to update Binary log:

  1. Master Binlog dump
  2. Master Database.

if there do not have the Binlog dump to update the Binary log, the Master Database can update the Binlog after updated too.

I guess this can increase the Relay log read content advanced. but why the master database should update the Binlog again? For confirmation?

CodePudding user response:

The diagram is confusing. There is just one thing happening, it is just described in two ways. Here's what is happening. (I prefer to use the terms "source" and "replica," according to current MySQL documentation.)

  1. Source instance executes a transaction against its database.
  2. Source instance writes the transaction's event to its binary log.
  3. Replica instance's IO thread connects to the source instance.
  4. Replica's IO thread runs the admin command binlog dump. This waits for the source instance to write events to its binary log, and downloads them as soon as they happen.
  5. Replica's IO thread writes the events it downloaded to the relay log on the replica instance.
  6. Replica's SQL thread waits for events to be written to the relay log.
  7. Replica's SQL thread reads from the relay log, and executes them against the replica's database.
  • Related