GuidesData Sync

Example - Sync from MySQL to Tacnode

This guide provides detailed instructions for setting up data synchronization from MySQL to Tacnode, including prerequisites, permissions, and configuration requirements.

Prerequisites

Network Configuration

Ensure network connectivity is properly configured. For detailed network setup instructions, see Data Sync Network Configuration.

Required Permissions

Permission requirements depend on the type of synchronization job:

Full Synchronization Only

For jobs that only perform full data synchronization, grant the following permissions:

mysql> GRANT SELECT, SHOW DATABASES ON *.* TO '${user}' IDENTIFIED BY '${password}';
       FLUSH PRIVILEGES;

Where:

  • ${user}: The username for the synchronization job
  • ${password}: The password for the specified user

Full + Incremental Synchronization

For jobs that include incremental synchronization capabilities, additional replication permissions are required:

mysql> GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '${user}' IDENTIFIED BY '${password}';
       FLUSH PRIVILEGES;

Enable Binary Logging (Required for Incremental Sync)

Incremental synchronization requires MySQL binary logging to be properly configured.

1. Verify Current Configuration

Check if binary logging is enabled and properly configured:

mysql> SELECT @@log_bin; -- Should return 1 (enabled)
mysql> SHOW VARIABLES LIKE 'server_id';
mysql> SHOW VARIABLES LIKE 'binlog%';

2. Required Parameter Values

Verify that the following parameters are set correctly:

ParameterRequired ValueDescription
server_idNon-empty positive integerUnique identifier for the MySQL server
log_bin1 (ON)Enables binary logging
binlog_formatROWRow-based replication format
binlog_row_imageFULLComplete row image for replication

3. Configuration Updates

If any parameters don't match the required values:

Self-hosted MySQL:

  1. Update the my.cnf or mysqld.cnf configuration file
  2. Add or modify the required parameters:
    [mysqld]
    server_id = 1
    log_bin = mysql-bin
    binlog_format = ROW
    binlog_row_image = FULL
  3. Restart the MySQL service

Cloud RDS (AWS, GCP, Azure):

  1. Access your cloud provider's RDS console
  2. Modify the database parameter group
  3. Update the required parameters
  4. Apply changes and restart the database instance

Data Source Configuration

Configure the MySQL connection using these required parameters:

ParameterDescriptionExample
HostMySQL server addressmysql.example.com
PortMySQL service port3306 (default)
UsernameUser with required permissionssync_user
PasswordPassword for the specified usersecure_password
DatabaseTarget database name (optional)production_db

Default Object Mapping

Tacnode uses the following default mapping rule for MySQL objects:

concat(SOURCE_DATABASE, '.', 'public', '.', SOURCE_OBJECT)

Mapping Logic:

  • Source: database_name.table_name (MySQL format)
  • Target: database_name.public.table_name (Tacnode format)

Example:

  • MySQL table: ecommerce.users
  • Tacnode table: ecommerce.public.users

Data Type Mapping

Tacnode automatically converts MySQL data types to compatible Tacnode types:

Numeric Types

MySQL TypeTacnode TypeNotes
TINYINTINT28-bit integer
SMALLINTINT216-bit integer
MEDIUMINTINT424-bit integer
INTINT432-bit integer
BIGINTINT864-bit integer
TINYINT UNSIGNEDINT2Unsigned 8-bit
SMALLINT UNSIGNEDINT4Unsigned 16-bit
MEDIUMINT UNSIGNEDINT4Unsigned 24-bit
INT UNSIGNEDINT8Unsigned 32-bit
BIGINT UNSIGNEDNUMERICUnsigned 64-bit

Decimal and Floating Point

MySQL TypeTacnode TypeNotes
NUMERICNUMERICExact numeric
DECIMALNUMERICExact decimal
DECIMAL UNSIGNEDNUMERICUnsigned decimal
FLOATFLOAT4Single precision
FLOAT UNSIGNEDFLOAT4Unsigned single precision
DOUBLEFLOAT8Double precision
DOUBLE UNSIGNEDFLOAT8Unsigned double precision

Character and Text Types

MySQL TypeTacnode TypeNotes
CHARCHARFixed-length character
VARCHARVARCHARVariable-length character
TINYTEXTTEXTShort text
TEXTTEXTStandard text
MEDIUMTEXTTEXTMedium text
LONGTEXTTEXTLong text

Binary Data Types

MySQL TypeTacnode TypeNotes
BINARYBYTEAFixed-length binary
VARBINARYBYTEAVariable-length binary
TINYBLOBBYTEAShort binary data
BLOBBYTEAStandard binary data
MEDIUMBLOBBYTEAMedium binary data
LONGBLOBBYTEALong binary data

Special Types

MySQL TypeTacnode TypeNotes
ENUMTEXTEnumerated values as text
SETTEXTSet values as text

Next Steps

After configuring your MySQL data source:

  1. Test Connection: Verify connectivity using the Test Connection feature
  2. Select Objects: Choose which databases and tables to synchronize
  3. Configure Mapping: Customize object and column mappings if needed
  4. Set Policies: Configure synchronization behavior and conflict resolution
  5. Monitor Job: Track synchronization progress and performance

For detailed steps on these configuration phases, refer to the Data Sync Quick Start guide. | DATE | DATE | | DATETIME | TIMESTAMP | | TIMESTAMP | TIMESTAMPTZ | | TIME | TIME | | YEAR | INT2 | | JSON | JSONB |