Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

How does replication work in MySQL, and what is the difference between asynchronous, semi-synchronous and group replication?

Replication copies changes from a source server to one or more replicas. The source writes every change into its binary log; each replica has an I/O thread that pulls those events into a local relay log, and an applier thread that replays them.

The three modes differ in how long the source waits before telling the client the commit succeeded:

  • Asynchronous (the default) — the source commits and replies immediately, without waiting for any replica. Fastest, but if the source dies before a replica catches up, those transactions are lost.
  • Semi-synchronous — the source waits until at least one replica confirms it has written the event to its relay log. It does not wait for the replica to apply it. This trades a little latency for a much smaller window of data loss.
  • Group Replication — a group of servers agree on transactions using a consensus protocol, giving you automatic failover and either single-primary or multi-primary writes. This is the foundation of InnoDB Cluster.

Binary log formats also matter: ROW is the safe default, STATEMENT is compact but unsafe for non-deterministic functions, and MIXED switches between them.

All MySQL interview questions

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as