Master MySQL Replication: Async, Semi‑Sync, and Full‑Sync Architectures Explained
This article outlines MySQL’s three primary replication architectures—async, semi‑sync, and full‑sync—detailing their mechanisms, typical topologies, performance trade‑offs, and suitable scenarios such as read‑heavy web services, high‑availability setups, and strict consistency requirements like financial transactions.
MySQL is a core component of large‑scale systems; the following sections detail its main replication architectures.
MySQL Asynchronous Replication Architecture
Asynchronous replication is MySQL's default and most widely used mode, prioritizing maximum write performance. The primary server handles write operations while one or more replica servers handle reads. After a write, the primary returns immediately without waiting for replicas, ensuring low latency for writes.
Typical topology: one primary, multiple replicas. Advantages: reduced load on the primary and strong read scalability, suitable for read‑heavy, write‑light workloads. Disadvantages: noticeable replication lag, making it unsuitable for scenarios requiring real‑time data consistency.
MySQL Semi‑Synchronous Replication Architecture
Semi‑synchronous replication improves on the asynchronous model by increasing data reliability. After the primary commits a transaction, it must wait for at least one replica to acknowledge receipt of the binlog and write it to its relay log before confirming success to the client.
Common setups include primary‑primary (dual‑primary) or primary‑backup configurations. Advantages: higher data safety and reduced risk of loss. Disadvantages: slightly higher latency compared to pure asynchronous replication. Real‑world use case: primary‑primary with MHA automatic failover.
MySQL Full‑Sync Replication Architecture
Full‑sync replication requires all nodes to confirm transaction completion, guaranteeing strong consistency across the entire cluster.
Typical topologies are multi‑primary/multi‑replica or distributed clusters such as Galera Cluster. Advantages: ensures data consistency on all nodes. Disadvantages: significant performance overhead, making it suitable only for workloads that demand strict consistency, such as financial transactions, payment processing, or core inventory systems where any data loss or inconsistency is unacceptable.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Mike Chen's Internet Architecture
Over ten years of BAT architecture experience, shared generously!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
