Outbound Serial Replication from Distributed Transactions to MariaDB Xpand


MariaDB SkySQL customers can configure outbound serial replication from a Distributed Transactions service to MariaDB Xpand.

Alternatively, if your Distributed Transactions service uses MariaDB Xpand 6, parallel replication can be used instead of serial replication. For additional information, see "Outbound Serial Replication from Distributed Transactions to MariaDB Xpand".

For additional information about the stored procedures used to configure replication with Distributed Transactions services, see "SkySQL Replication Helper Procedures for Distributed Transactions".

Use Cases

  • Offsite replica for Disaster Recovery (DR)

  • Dedicated replica for reporting workloads


  • Distributed Transactions


To configure outbound replication from your Distributed Transactions service in SkySQL to an external replica server using MariaDB Xpand, the following requirements must be met:

  • The external replica server must use the same character set and collation as the SkySQL service.

Create User Account for Replication

On the SkySQL service, create a user account to use for replication.

A replication user account can be created by calling the sky.install_repl_users() stored procedure:

CALL sky.install_repl_users();

Get User Account Credentials for Replication

On the SkySQL service, get the credentials for the user account created in the last step.

The credentials can be obtained by calling the sky.get_replica_creds() stored procedure:

CALL sky.get_replica_creds();
| PRIMARY_USER                  | PRIMARY_PASSWORD                 |
| skysql_replication            | <password>                       |

Check User Account

On the SkySQL service, confirm that the new user has sufficient privileges by executing SHOW GRANTS:

SHOW GRANTS FOR 'skysql_replication'@'%';
| Grants for skysql_replication@%                                       |
| GRANT REPLICATION SLAVE ON *.* TO 'skysql_replication'@'%'            |

Add External Replica to Allowlist

On the SkySQL Customer Portal, add the IP address of the external replica server to the SkySQL service's allowlist.

Create Binary Log

On the SkySQL service, create a binary log.

A binary log can be created by calling the sky.create_binlog() stored procedure. The stype parameter should be set to xpand:

CALL sky.create_binlog('xpand', 'xpand-bin');

Obtain Binary Log File and Position

On the SkySQL service, obtain the binary log file and position.

The binary log file and position can be obtained by calling the sky.binlog_status() stored procedure:

CALL sky.binlog_status();
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |
| xpand-bin.000001 |        4 | NULL         | NULL             |

Configure Replication

On the external replica server, configure replication using the connection parameters for your MariaDB SkySQL service.

Replication can be configured using the CREATE SLAVE statement:

CREATE SLAVE 'default'
  • Replace FULLY_QUALIFIED_DOMAIN_NAME with the Fully Qualified Domain Name of your service

  • Replace TCP_PORT with the read-write or read-only port of your service

Start Replication

On the external replica server, start replication.

Replication can be started using the START SLAVE statement:


Check Replication Status

On the external replica server, check replication status.

Replication status can be checked using the SHOW SLAVE STATUS statement:

*************************** 1. row ***************************
             Slave_Name: default
           Slave_Status: Running
            Master_Host: my-service.mdb0002147.db.skysql.net
            Master_Port: 5001
            Master_User: skysql_replication
        Master_Log_File: xpand-bin
          Slave_Enabled: Enabled
           Log_File_Seq: 1
           Log_File_Pos: 4
             Last_Error: no error
      Connection_Status: Connected
   Relay_Log_Bytes_Read: 0
Relay_Log_Current_Bytes: 0
  Seconds_Behind_Master: NULL