Understanding MySQL Group Replication: Features, Differences, and Use Cases
MySQL 5.7.17 introduced Group Replication, a feature that ensures full data consistency across multiple MySQL nodes by synchronizing changes, offering high consistency, fault tolerance, elasticity, and flexible single‑master or multi‑master modes, making it suitable for elastic replication, high‑availability sharding, and as a replacement for traditional master‑slave replication.
Introduction
MySQL 5.7.17 introduced an important feature: Group Replication .
What does Group Replication do?
It can be simply understood as a way to keep data across multiple MySQL nodes completely consistent .
When a modification is executed on any node, the other nodes automatically synchronize and guarantee data consistency.
Difference between Group Replication and Master‑Slave Replication
In a master‑slave setup, the slave is merely a subordinate of the master; the master performs write operations independently, regardless of whether the slave keeps up, and the slave tries to stay consistent with the master.
In Group Replication, all nodes act as masters. When a master receives a write request, it must notify the other masters before committing the transaction; only if all agree will the write be executed, ensuring identical data across nodes.
Features
(1) High Consistency
It uses the well‑known distributed consensus algorithm Paxos to guarantee identical state among nodes.
(2) High Fault Tolerance
As long as a majority of nodes remain operational, the group continues to work.
An automatic detection mechanism resolves resource conflicts by following a first‑come‑first‑served rule.
It also includes built‑in automatic brain‑split protection.
(3) Elasticity
Adding or removing nodes is automatic.
When a new node joins, it automatically synchronizes its state from existing nodes until it becomes consistent.
If a node is removed, the remaining nodes automatically detect the change and maintain the new group information.
(4) Flexibility
Supports single‑master mode and multi‑master mode .
In single‑master mode, a primary is automatically elected and all updates occur on that primary.
In multi‑master mode, all servers can process updates simultaneously.
Application Scenarios
(1) Elastic Replication
For cloud database services that require a highly flexible replication environment where the number of servers can dynamically increase or shrink without affecting external access.
(2) High‑Availability Sharding
Sharding is a common method for horizontal write scaling; using Group Replication enables high‑availability sharding, with each shard corresponding to a replication group.
(3) Replacement for Master‑Slave Replication
Using a single master highlights a single point of failure; writing to the entire group offers better scalability.
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.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
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.
