×
Community Blog Best Practice: Cross-Border Database Synchronization

Best Practice: Cross-Border Database Synchronization

This article explains the best practice of using a cutting-edge product combo to help users transfer data in a safe, reliable, and cost-effective way.

1. Best Practice Overview

In today's digital world, companies often need to transfer or sync data across borders for different reasons, including collaborating with international partners, developing new local markets for business globalization strategy, or storing information in overseas servers for disaster recovery. There are many methods for cross-border data transfer (such as public networks and VPN). No matter what approach you choose, you cannot turn a blind eye to the huge costs and the risk of cyberattacks, which can lead to data breaches, loss of confidential information, and reputational damage for companies.

This article explains the best practice of using a cutting-edge product combo to help users transfer data in a safe, reliable, and cost-effective way.

1.1. Scenarios (Who Should Read This)

You should follow this best practice if you want to do any of the following:

  • Perform cross-border database migration and synchronization
  • Build disaster recovery (DR) ability for business-critical databases

1.2. Topology & Workflow

The diagram below shows the resources and topology used in this best practice. It is performed based on the following workflow:

  • Creating secure network conditions for data transfer through Cloud Enterprise Network (CEN)
  • Configuring synchronization tasks between databases with Data Transmission Service (DTS)
  • Verifying data and performing performance evaluation

1

1.3. Benefits

  • Secure: Whitelist, virtual private cloud (VPC), security group, and other access control functions enhance the security powered by network isolation.
  • Easy to Use: Cloud Enterprise Network (CEN) supports communication, isolation, and redirect policies within regions. Implementing CEN makes it easy to build a network foundation for cross-border data transfer with low costs.
  • Efficient: Data Transmission Service (DTS) allows you to manage data to be synced and check performance metrics with user-friendly interfaces.

2. Prerequisites

Please make sure that you have registered for an Alibaba Cloud account with valid payments before getting started.

» Register your Alibaba Cloud account and finish real-name registration. Log on to your Alibaba Cloud account and go to Account Center to check your account status.

» Add valid payments to your Alibaba Cloud account. Log on and go to Alibaba Cloud User Center to check the balance.

When the account is ready, activate and launch the following Alibaba Cloud services and resources for your account:

3. Process

3.1. Step 1: Prepare Resources

3.1.1. Purchase the Source RDS Instance

In this part, an RDS will be launched to work as the source database. If you already have running RDS instances, please skip this part.

1.  Go to the RDS buy page and choose a specific region to deploy the source database with proper specifications:

2
3

2.  Select a VPC in which the RDS instance will be deployed.

You need to mark the ID of the selected VPC, as this information will be used again later.

4
5

3.  Go through all the configurations, confirm your order, and complete the payment.

6

As shown in the example above, a 4C16G RDS instance with 100GB storage will be created in a selected region.

3.1.2. Purchase the Target RDS Instance

Similar to purchasing a source database, create another RDS in a different region as the target database. Record the VPC ID of the target database, as this information will also be used later.

7
8
9
10
11

Refresh the RDS console after a while, and you can see the new instance was created successfully and is in the running state.

3.1.3. Purchase and Configure CEN

1.  Go to the CEN console and click Create CEN Instance:

12

2.  Customize the name of the CEN instance and click OK to start creating:

13

3.  When the creation process is completed, click View Details on the prompt to continue:

14

4.  On the details page of the CEN instance, click the corresponding icon to add the VPC of the source RDS and the target RDS so it can establish a connection between these two isolated networks.

15

5.  Configure the blanks based on the VPC information of the source RDS, including Network Type, Region, Resource Owner, VPC ID, Vswitch, etc.

16
17

6.  Review all the configurations and click OK to finish the peer network settings of the source VPC.

18

7.  When the previous settings are successfully completed, click Create more connections to add the VPC of the target RDS.

19

You may encounter repeated operations, but remember to choose the same region and the network information corresponding to your target RDS.

20
21
22

3.1.4. Purchase a DTS Data Synchronization Instance

1.  Go to the DTS console, choose Data Synchronization, and switch to a region where your target RDS resides. Then, click Purchase Instance:

23

2.  On the DTS buy page, make sure Data Synchronization is selected and click Application for DTS cross-border data synchronization to see more options for destination regions.

24
25

3.  Confirm your order and complete payment:

26

You can choose different specifications and topologies (such as one-way or bidirectional synchronization) based on your needs. Double-check all configurations before settling on one.

3.2. Step 2: Set up the Test Environment

3.2.1. Configure the Source RDS and Prepare Test Data

1.  Create Database Accounts and Data on the Source RDS Instance:

27

2.  Create databases and tables on the source RDS for testing:

28

3.  Set up a whitelist and connection string and then get the IP of the source RDS instance by a ping from an ECS instance or with the help of Alibaba Cloud customer support (using the ticket service).

3.2.2. Configure the Target RDS

1.  Create Database Accounts on the Target RDS Instance:

29

2.  Set up the whitelist and connection string and then get the IP of the target RDS instance by a ping from an ECS instance or with the help of Alibaba Cloud customer support (using the ticket service).

30
31

3.3. Step 3: Configure Database Migration

1.  Go to the DTS console and find the instance created in the previous step within the Data Synchronization menu and click Configure Task.

32

2.  Set Access Method as CEN and fill in all the blanks about the source and the target RDS.

In this case, the IP addresses of both RDS Instances should be in IP format and do not support domain names (like connection strings). Make sure you have the internal IPs of the source and target RDS.

33

3.  Then, click Test Connectivity and Protocol to continue.

34

4.  When the network connection test passes, complete the rest of the configuration regarding the objects to be synchronized and advanced settings (such as full data verification options).

35
36

We recommend performing full data verification after migration to ensure the accuracy of your data.

37
38

5.  Perform precheck and start the task:

39

It may take a while for it to complete the full data synchronization before moving on to the next stage. You can go back to the DTS task list and observe the status of the task in case any exceptions occur.

3.4. Step 4: Results & Analysis

When the status of the DTS data synchronization task turns out to be Incremental Data Synchronization, it is time to try the effect of incremental data sync.

40

1.  Access the Source and Target RDS on the DMS console

41

2.  Insert Data on the Source RDS

42

3.  Select New Data on the Target RDS Immediately

43

4. Conclusion

Cross-border data transfer is essential in today's globalized world. Our innovative solutions involve less effort to reach your goals at an affordable price and in a secure manner.

About CEN

Cloud Enterprise Network (CEN) is a highly available network built on the global private network of Alibaba Cloud. CEN uses transit routers to establish inter-region connections between virtual private clouds (VPCs). This enables VPCs to communicate with data centers and builds flexible, stable, enterprise-class networks on the cloud.

About DTS

Data Transmission Service (DTS) is a real-time data streaming service. DTS supports data transmission between data sources (such as relational, NoSQL, and online analytical processing (OLAP) databases). DTS provides data synchronization, data migration, change tracking, data integration, and data processing features. This enables you to manage data within a secure, scalable, and high-availability architecture.

Database Free Trial:
https://www.alibabacloud.com/product/databases#J_2463051000

2 2 1
Share on

ApsaraDB

456 posts | 98 followers

You may also like

Comments

Kidd Ip May 16, 2023 at 1:02 am

Thank you for the sharing, CEN is quite useful, and reliable especially cross-border connection with mainland

Dikky Ryan Pratama May 17, 2023 at 1:50 am

Thank you!