Using DTS and DG to access external databases
Database Gateway (DG) provides a simple, low-cost way to connect your on-premises or third-party cloud databases to Alibaba Cloud. Once connected, you can use these databases as the source or destination database for data migration, data synchronization, or data subscription tasks in Data Transmission Service (DTS).
Background
- Express Connect, VPN gateways, and Smart Access Gateway are costly and unsuitable for individual users.
- Exposing database service ports to the public network creates potential security risks.
- Building a custom proxy to forward service requests can be unstable and requires significant technical expertise.
Data Management (DMS) integrates with Database Gateway, letting you add databases from other cloud providers or your on-premises environment. This approach allows you to establish a secure connection without exposing your database to the public network. It encrypts data in transit and requires no firewall configuration, which significantly lowers the barrier to entry. To learn more about Database Gateway, see What is Database Gateway.
Procedure
- Create a Database Gateway. For more information, see Create a Database Gateway.
- Add the database that you want to connect. For more information, see Add a database.
Database Gateway is currently free of charge. When you use it, take note of the following:
- The machine that hosts the gateway agent must have access to the public network, but you do not need to expose any ports. To ensure connection speed and stability, the machine requires a minimum outbound public bandwidth of 10 Mbps.
- The machine must be able to connect to the database. For lower network latency, place the gateway agent and the database in the same internal network.
- This example uses a data migration task in Data Transmission Service (DTS). Log on to the DTS console. In the left-side navigation pane, click Data migration, and then click Create migration task in the upper-right corner.
- On the Create migration task page, specify the required parameters. For Instance Type, select Database without public IP:Port (accessed through Database Gateway). Then, select the database endpoint from the drop-down list to use the database connected through Database Gateway as the source or destination database.
In the source database information, you must also configure fields such as Instance region, Database Gateway ID (you can click Create Database Gateway to create a new one), Database type (for example, MySQL), and Database account. For incremental data migration, we recommend using data synchronization.Note If you select Database without public IP:Port (accessed through Database Gateway) as the instance type, cross-region migration is not supported. The source and destination databases must be in the same region.
- After specifying the parameters, click Test connectivity. If the test is successful, click Set whitelist and next in the lower-right corner to configure migration types and advanced settings.