MySQL Group Replication is a MySQL plugin and it builds on the existing MySQL replication infrastructure, taking advantage of features such as the binary log, row-based logging, and global transaction identifiers. It integrates with current MySQL frameworks, such as the performance schema or plugin and service infrastructures. The following figure presents a block diagram depicting the overall architecture of MySQL Group Replication.
Starting from the top of the figure, there is a set of APIs that control how the Group Replication plugin interacts with MySQL Server ( the gray box). There are interfaces to make information flow from the server to the plugin and vice versa. Such interfaces isolate the server core from the plugin and are mostly hooks placed in the transaction execution pipeline. In one direction, from server to the plugin, there are notifications such as the server is starting, the server is recovering, the server is ready to accept connections, the server is about to commit a transaction, and so on. In the other direction, the plugin instructs the server to commit or abort ongoing transactions, queue transactions in the relay-log, and so on.
Below the API block is a set of components that react when a notification is routed to them. The capture component is responsible for keeping track of context related to transactions that are executing. The applier component is responsible for executing remote transactions on the database. The recovery component manages distributed recovery and is responsible for getting a server that is joining the group up to date by selecting the donor, orchestrating the catch up procedure and reacting on donor failures.
Continuing down the stack, the replication protocol module contains the specific logic of the replication protocol. It handles conflict detection, receives and propagates transactions to the group.
The first green box is the Group Communication System (GCS) API. It is a high level API abstracting the properties required to build a replicated state machine (see Section 17.1, “Group Replication Background”). Therefore it decouples the implementation of the messaging layer from the remaining upper layers of the plugin. The MySQL Group Replication plugin contains an implementation of a Paxos based group communication engine.