Skip to content

MariaDB

TwinCommit captures changes from MariaDB by reading the row-based binary log with MariaDB GTIDs. Changes are grouped by transaction and applied at commit, in commit order. No plugins or triggers are installed on the server.

Supported: MariaDB 10.6, 10.11 and 11.4 LTS · Amazon RDS for MariaDB · SkySQL · Galera clusters (capture from one node with log_slave_updates).

# my.cnf
[mariadb]
server_id = 201
log_bin = mariadb-bin
binlog_format = ROW
binlog_row_image = FULL
expire_logs_days = 7
# Galera only: write replicated writesets to the local binlog
log_slave_updates = ON
CREATE USER 'twincommit'@'%' IDENTIFIED BY '********';
GRANT REPLICATION SLAVE, REPLICATION CLIENT, BINLOG MONITOR ON *.* TO 'twincommit'@'%';
GRANT SELECT ON app.* TO 'twincommit'@'%';

BINLOG MONITOR is the MariaDB 10.5+ name for the privilege that allows SHOW BINLOG STATUS.

Every replicated table needs a primary key or a non-null unique key.

source:
type: mariadb
host: mariadb-1.internal
port: 3306
user: twincommit
password: ${MARIADB_PASSWORD}
server_id: 4202

TwinCommit streams binlog events from the MariaDB GTID position (domain-server-sequence) stored in its checkpoint. On Galera, capture from any node that has log_slave_updates = ON. If that node fails, point TwinCommit at another node and it resumes from the same GTID.

  • Statement and mixed binlog formats are not supported.
  • System-versioned tables are captured as their current rows only.
  • ColumnStore and Spider engine tables are not captured.