Configure Replication with MariaDB Xpand

Overview

MariaDB Xpand provides serial and parallel replication for applications that require disaster recovery or require data to be distributed between different geo-locations:

  • Inbound replication can be used to replicate to Xpand from another Xpand cluster, MariaDB Server, or MySQL 5.7

  • Outbound replication can be used to replicate from Xpand to another Xpand cluster, MariaDB Server, or MySQL 5.7

  • Disaster recovery can be implemented by replicating to an Xpand cluster in a separate region or data center

  • Data can be globally distributed by replicating to Xpand clusters in different geo-locations

  • OLTP and OLAP workloads can be split by replicating between dedicated Xpand clusters for each workload

  • Active-active and active-passive configurations are supported

  • Parallel replication can be used to minimize latency and provide extremely scalable replication between Xpand clusters:

    • Multiple Xpand nodes stream and apply events independently in parallel

    • Xpand ensures transactional consistency and commits transactions in the same order as the replication primary

This page explains how to configure replication with MariaDB Xpand. Before configuring replication, ensure that the special cases for replication do not apply to your environment.

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

Compatibility

  • MariaDB Xpand 5.3

  • MariaDB Xpand 6

Types of Replication

This page describes Xpand replication, which uses a single stream to write and read binlogs. Xpand also supports parallel replication, which is more performant and can be used to replicate to/from Xpand only.

Xpand supports the MySQL's replication protocol as both a Slave and a Master.

  • Xpand supports replication to/from MariaDB 10.3+ with no special configuration.

  • Xpand supports replication to/from MySQL 5.7 with GTID mode disabled.

Supported Topologies

Here is a sampling of the topologies for replication supported by Xpand:

Xpand can serve as a Master or a Slave to MariaDB 10.3+, MySQL 5.7, or Xpand:

Xpand also supports slaving from multiple distinct binlogs (consolidation) and Master-Master replication:

Xpand also supports the creation of multiple binary logs (binlogs), each of which can correspond to specific databases and can be accessed by distinct replication Slaves. When running multiple-Slave configurations, Xpand takes advantage of each node by load-balancing replication connections in a round-robin fashion. For assistance in determining the best topology for your application or whether a specific topology is supported, contact MariaDB Support.

Special Cases

Row-Based Replication (RBR) and Primary Keys

When row-based replication (RBR) is used with MariaDB Xpand, all replicated tables should have a Primary Key.

For row-based replication, Xpand uses the table's Primary Key to find the specific row referenced in each binlog event. If any tables do not have a Primary Key, Xpand must scan the table for the row, which can have a negative impact on performance.

MariaDB Server Global Transaction IDs (GTIDs)

MariaDB Xpand does not support replication using MariaDB Server's global transaction IDs (GTIDs), but Xpand can replicate from MariaDB Server 10.2 and later using the binary log file and position.

To enable replication between a primary Xpand cluster and a replica MariaDB Server node:

To enable replication between a primary MariaDB Server node and a slave Xpand cluster:

  • No special configuration is needed.

  • The normal syntax for creating a replication slave can be used to configure Xpand to be a replication slave of a primary MariaDB node.

  • For additional information, see "Configure MariaDB Xpand as a Replication Slave".

MySQL Global Transaction IDs (GTIDs)

MariaDB Xpand does not support replication using MySQL's global transaction IDs (GTIDs), but Xpand can replicate from MySQL using the binary log file and position.

MySQL produces GTIDs beginning with MySQL 5.6 (optional) and MySQL 5.7 (required).

To enable replication between a primary Xpand cluster and a MySQL 5.7 slave:

  • The MySQL slave must have the gtid_mode system variable set to OFF, OFF_PERMISSIVE, or ON_PERMISSIVE.

  • The MySQL slave must have the enforce_gtid_consistency system variable set to OFF.

  • The normal syntax for creating a binlog can be used to configure Xpand to be a replication master of a MySQL 5.7 slave.

  • For additional information, see "Configure MariaDB Xpand as a Replication Master".

To enable replication between a MySQL 5.7 master and a slave Xpand cluster:

  • No special configuration is needed.

  • Xpand ignores the values of the gtid and server_uuid system variables that it encounters in the binlog.

  • Similar to a MySQL 5.6 slave with gtid_mode set to OFF, Xpand does not pass replicated GTID events to its binlogs.

  • The normal syntax for creating a replication slave can be used to configure Xpand to be a replication slave of a MySQL 5.7 master.

  • For additional information, see "Configure MariaDB Xpand as a Replication Slave".

Ring Topologies

MariaDB Xpand does not support ring replication topologies.

Time Zones

To ensure correct matching of Master and Slave data when replicating between Xpand and a MySQL instance, set both DBMSes to the same time zone. If time zones differ, you risk mismatched data.