Multiple Serial Replication Slaves with MariaDB Xpand

Overview

Xpand provides sophisticated and scalable support for running many serial replication slaves on a cluster, including:

  • Even distribution of serial replication slaves among nodes in the cluster.

  • Even distribution of multiple serial replication slaves on the same node among CPU cores.

Compatibility

  • MariaDB Xpand 5.3

  • MariaDB Xpand 6.0

  • MariaDB Xpand 6.1

Balancing

Serial replication slaves are balanced among nodes following two rules:

  1. When a new serial replication slave is created, it starts on the node with the fewest currently enabled serial replication slaves.

  2. After a group change, all serial replication slaves restart automatically and will be allocated to nodes according to rule 1 as if they were newly created.

Multiple serial replication slaves on the same node are balanced among CPU cores following three rules:

  1. When a new serial replication slave is started, it starts on the CPU core that has the least number of serial replication slaves (either started or stopped).

  2. Dropping a serial replication slave releases an allocated CPU core, allowing a new serial replication slave to take its place (an existing serial replication slave will not take its place).

  3. After a group change, all serial replication slaves restart automatically and will allocate CPU cores according to rule 1 as if they were newly created.

These changes will only show performance improvements on clusters with many serial replication slaves running concurrently. For example, a 3-node cluster with 3 serial replication slaves will have 1 slave on each node. A 3-node cluster (each node with 4 CPU cores) with 9 serial replication slaves will have 3 slaves on each node, with one slave running on each of core 1, core 2, and core 3 (core 0 is not used by replication slaves). A 3-node cluster (each node with 3 CPU cores) with 9 serial replication slaves will have 3 slaves on each node, with two slaves running on core 1 and one slave on core 2.

Parallel Replication

A parallel replication slave does not have a single slave process that runs on a single node, the way a serial replication slave does.

For information on the architecture related to parallel replication with MariaDB Xpand, see "MariaDB Xpand Parallel Replication Architecture".