Cloud Computing 5 min read

How to Real-Time Sync MySQL RDS to Analytic DB with Alibaba DTS and dts-ads-writer

This guide explains how to enable Alibaba Cloud Data Transmission Service (DTS) with the dts-ads-writer plugin to continuously synchronize changes from an RDS for MySQL instance to a real‑time write table in an analytic database, covering prerequisites, configuration, and monitoring steps.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Real-Time Sync MySQL RDS to Analytic DB with Alibaba DTS and dts-ads-writer

Prerequisites

You must enable Alibaba Cloud Data Transmission Service in the same cloud account as your RDS for MySQL instance. Download the dts-ads-writer plugin, unzip it on a server that can access the Internet (Alibaba Cloud ECS is recommended), and ensure Java 6+ (JRE/JDK) is installed.

Prerequisite diagram
Prerequisite diagram

Steps

Create the target table in the analytic database with the data update type set to real‑time write . Keep column names identical to those in MySQL.

In the DTS console, create a data subscription channel and record its channel ID.

Edit app.conf in the dts-ads-writer directory according to the example below, then restart the writer.

Steps diagram
Steps diagram

Configuration Example

The tables node maps rds_db.rds_table to ads_table, with column mappings col1col1_ads and col2col2_ads:

tables {
  rds_db.rds_table = {
    targetTable = "ads_table",
    columnMap = {
      col1 = "col1_ads",
      col2 = "col2_ads"
    }
  }
}
Configuration example
Configuration example

Important Notes

The primary key definitions of the MySQL table and the analytic DB table must be identical; otherwise data inconsistency may occur.

Only one analytic DB (specified by adsJdbcUrl) can be used per plugin process.

Each plugin process can subscribe to only one data channel; changing the subscription requires a process restart.

DDL operations on MySQL are not synchronized.

Changes to app.conf take effect after restarting the plugin.

Historical data can be re‑synced only for the most recent 24 hours by adjusting the consumption offset in the DTS console.

Synchronization performance is proportional to the server’s Internet bandwidth and disk IOPS.

Running and Monitoring

Start the writer with: sh bin/startup.sh Set up a monitoring program to watch the writer process and parse log entries. Errors are logged in the format ErrorCode=XXXX ErrorMessage=XXXX, which can be used for alerts.

Log monitoring
Log monitoring
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.

Real-Timemysqldata synchronizationDTSAlibaba Cloud
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

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.