Cloud Computing 7 min read

How to Real-Time Sync MySQL RDS to Analytic DB with Alibaba Cloud Data Transmission

This guide explains how to use Alibaba Cloud Data Transmission and the dts-ads-writer plugin to continuously synchronize MySQL RDS tables to an analytical database, covering prerequisites, configuration files, step‑by‑step setup, and important considerations for reliable data replication.

ITPUB
ITPUB
ITPUB
How to Real-Time Sync MySQL RDS to Analytic DB with Alibaba Cloud Data Transmission

Overview

Alibaba Cloud Data Transmission Service (DTS) provides combined data migration, subscription, and real‑time synchronization for structured storage products. It enables millisecond‑level asynchronous data transfer across public and hybrid cloud environments, allowing changes in an RDS for MySQL instance to be streamed instantly to an analytical database.

Prerequisites

Enable the Data Transmission service in the same Alibaba Cloud account that owns the RDS for MySQL instance.

Download the dts-ads-writer plugin, unzip it on a server that can access the Internet (an Alibaba Cloud ECS instance is recommended for reliability).

Install Java 6 or newer (JRE/JDK) on the server.

Step‑by‑Step Procedure

Create the target table in the analytical database. Set the table’s data update type to real‑time write and ensure column names match those in MySQL.

In the DTS console, create a data subscription channel and note its channel ID (Tunnel ID).

Edit the dts-ads-writer/app.conf file with the parameters shown in the configuration example below. Save the file and restart the writer whenever the file is modified.

Start the writer process: ./bin/startup.sh or sh bin/startup.sh Monitor the writer process and its log files. Errors are logged in the form ErrorCode=XXXX ErrorMessage=XXXX.

Configuration Example (app.conf)

{
  "dtsAccessId": "YOUR_ACCESS_ID",
  "dtsAccessKey": "YOUR_ACCESS_KEY",
  "dtsTunnelId": "YOUR_TUNNEL_ID",
  "adsUserName": "ADS_USERNAME",
  "adsPassword": "ADS_PASSWORD",
  "adsJdbcUrl": "jdbc:mysql://HOST:PORT/DATABASE",
  "tables": [
    {
      "source": {
        "primaryKeys": ["col1", "col2"],
        "db": "rds_db",
        "table": "rds_table",
        "skipColumns": ["col3"]
      },
      "target": {
        "table": "ads_table"
      },
      "columnMapping": {
        "col1": "col1_ads",
        "col2": "col2_ads"
      }
    }
  ]
}

Key Considerations

The primary‑key definitions of the source RDS table and the target analytical table must be identical; otherwise data inconsistency may occur.

Only one analytical database can be specified per writer process via adsJdbcUrl.

A writer process can bind to only one data subscription channel. Changing the channel requires a process restart.

DDL statements executed on the MySQL side are not synchronized to the analytical database.

Changes to app.conf take effect only after the writer is restarted.

If a full resynchronization is required, the maximum replay window is the most recent 24 hours; adjust the consumption offset in the DTS console.

Synchronization throughput is limited by the server’s Internet bandwidth and disk IOPS.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mysqldatabase migrationAlibaba CloudData Transmissionreal-time-sync
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.