Data Transmission Service (DTS) provides a stable and efficient solution for real-time database synchronization between different regions. For example, you can synchronize production data from the China (Hangzhou) region to the China (Shanghai) region for read/write splitting or disaster recovery. This topic describes two core network solutions for cross-region data synchronization using DTS. It helps you choose the best configuration for your scenario and guides you through the task creation process.
How it works
Regardless of the solution you choose, cross-region data synchronization in DTS follows a standard flow-based model that includes data extraction and data writing.
-
Data extraction: The DTS service connects to your source database to read data.
-
Data writing: The DTS service connects to your destination database to write data.
To establish these connections, DTS creates an endpoint in the virtual private cloud (VPC) that you specify. DTS communicates with the database instances through this endpoint. The entire cross-region sync network topology is determined by the following four key parameters. Understanding these parameters is essential for correctly configuring a DTS task:
DTS endpoints are available in two forms. For more information about the solutions, see Solution selection: DTS built-in network vs. your own network.
-
Cloud service CIDR block solution: Occupies an IP address from the 100.104.0.0/16 CIDR block.
-
VPC data channel: Occupies an IP address on the primary and secondary vSwitches that you select.
-
Source database address: The IP address or domain name and port that DTS uses to access the source database.
-
DTS source database endpoint VPC: The VPC where the DTS endpoint for accessing the source database is located. This VPC must have network access to the source database address.
-
Destination database address: The IP address or domain name and port that DTS uses to access the destination database.
-
DTS destination database endpoint VPC: The VPC where the DTS endpoint for accessing the destination database is located. This VPC must have network access to the destination database address.
All configurations that you make in the console are essentially combinations of these four parameters.
Applicable scope
Cross-border synchronization: If your sync task involves data transfer between the Chinese mainland and regions outside China, such as from China (Shanghai) to Germany (Frankfurt), the task is considered cross-border data synchronization. For compliance reasons, you must first request permission for cross-border data synchronization. Otherwise, you cannot create the task.
Solution selection: DTS built-in network vs. your own network
DTS provides two cross-region network solutions. You can use the following table to make a decision.
|
Comparison |
Solution 1: (Recommended) Use the built-in cross-region capability of DTS |
Solution 2: Use your own cross-region network |
|
Network path |
The cross-region connection is handled by DTS. The DTS source and destination instance endpoints are in different regions. The connection between these endpoints uses the built-in cross-region network of DTS. |
The VPC of the database access point and the instance are in different regions, and a cross-region network connects the access point to the instance. |
|
Ease of use |
High. The configuration is simple. You do not need to manage the underlying network. |
Medium. You need to establish the cross-region network in advance and manually specify the endpoint VPC. |
|
Cost structure |
DTS cross-region task fees. |
DTS same-region task fees + your own network product fees. |
|
Stability |
Virtual Private Cloud (VPC) provides high performance, low latency, and high stability. |
Stability depends on the quality and bandwidth of your own network. |
|
Recommendation |
Use this solution when both the source and destination databases are Alibaba Cloud instances, such as RDS or PolarDB. |
Choose this solution when the source and destination databases are in an on-premises data center or another cloud. You can also choose this solution if you need fine-grained control over the network path. |
Configure a cross-region sync task
This section uses an example of synchronizing an RDS instance from the China (Hangzhou) region to an RDS instance in the China (Shanghai) region to describe the configuration steps for each solution.
Scenario 1: (Recommended) Use the built-in cross-region capability of DTS
This solution uses the built-in cross-region capabilities of DTS. It is the easiest to configure and provides the most stable network. You do not need to worry about network details because DTS automatically handles all network connections.
-
Source database address and DTS source database endpoint VPC: DTS automatically uses the internal network address of the source database and its VPC.
-
Destination database address and DTS destination database endpoint VPC: DTS automatically uses the internal network address of the destination database and its VPC.
-
Network description: You do not need to manually configure a VPC peering connection or CEN. DTS securely connects the source and destination databases through its internal leased line network.
-
Configure the Source Database.
-
Set Access Method to Alibaba Cloud Instance.
-
Set Instance Region to China (Hangzhou).
-
Select your RDS Instance ID.
-
Enter the Database Account and Database Password.
-
-
Configure the Destination Database.
-
Set Access Method to Alibaba Cloud Instance.
-
Set Instance Region to China (Shanghai).
-
Select your RDS Instance ID.
-
Enter the Database Account and Database Password for the source database.
-
-
Complete the subsequent configurations and start the task. Follow the instructions in the console to complete the remaining configurations, run a precheck, and start the task.
For both the source and destination databases, set Cross-Alibaba Cloud Account to No. For the destination database, set Connection Method to Non-encrypted Connection.
Scenario 2: Use your own cross-region network
Use this solution when you need to access resources across regions through your own network. This solution requires you to manually specify the endpoint VPC for DTS. You must first establish network connectivity between the VPCs in the source and destination regions.
Data extraction phase
In this scenario, the DTS task is deployed in the destination region, China (Shanghai). It accesses the database in the source region, China (Hangzhou), through your own network.
-
Source database address and DTS source database endpoint VPC: You must first establish network connectivity between a VPC in the destination region (China (Shanghai)) and your source instance in China (Hangzhou). Then, in the DTS task configuration, specify this VPC as the endpoint VPC and provide the connection address of the source database.
-
Destination database address and DTS destination database endpoint VPC: DTS automatically uses the internal network address of the destination database and its VPC.
-
Configure the Source Database.
-
Set Access Method to Express Connect, VPN Gateway, or Smart Access Gateway.
-
Set Instance Region to China (Shanghai).
NoteThe selected region determines the deployment location of the DTS task. Because the endpoint is a VPC in China (Shanghai), you must set the task region to Shanghai.
-
Connected VPC: Select a VPC in China (Shanghai) that is connected to the source database in China (Hangzhou) through your private network.
-
Enter the Domain Name or IP, Port Number, Database Account, and Database Password for your China (Hangzhou) database.
-
-
Configure the Destination Database.
-
Set Access Method to Alibaba Cloud Instance.
-
For Instance Region, select China (Shanghai).
-
Select your RDS Instance ID.
-
Enter the Database Account and Database Password for the source database.
-
-
Complete the subsequent configurations and start the task. Follow the instructions in the console to complete the remaining configurations, run a precheck, and start the task.
Data writing phase
In this scenario, the DTS task is deployed in the source region, China (Hangzhou). It accesses the database in the destination region, China (Shanghai), through your own network.
-
Source database address and DTS source database endpoint VPC: DTS automatically uses the internal network address of the source database and its VPC.
-
Destination database address and DTS destination database endpoint VPC: You must first establish network connectivity between a VPC in the source region (China (Hangzhou)) and your destination instance in China (Shanghai). Then, in the DTS task configuration, specify this VPC as the endpoint VPC and provide the connection address of the destination database.
-
Configure the Source Database.
-
Set Access Method to Alibaba Cloud Instance.
-
Set Instance Region to China (Hangzhou).
-
Select your RDS Instance ID.
-
Enter the Database Account and Database Password for the source database.
-
-
Configure the Destination Database.
-
You can set Access Method to Express Connect, VPN Gateway, or Smart Access Gateway.
-
Set Instance Region to China (Hangzhou).
-
Connected VPC: Select a VPC in China (Hangzhou). This VPC must be connected to the source database in China (Shanghai) over your private network.
-
Enter the Domain Name or IP, Port Number, Database Account, and Database Password for your China (Shanghai) database.
-
-
Complete the subsequent configurations and start the task. Follow the instructions in the console to complete the remaining configurations, run a precheck, and start the task.