This topic describes how to use Database Gateway (DG) to connect an external database to Alibaba Cloud. DG is a gateway service that connects external databases to Alibaba Cloud at a low cost. You can connect on-premises databases or databases hosted on a third-party cloud to Alibaba Cloud through DG. After you use DG to connect an external database to Alibaba Cloud, you can specify the external database as the source or destination database when you create a migration, synchronization, or subscription task in Data Transmission Service (DTS).
- Use an Express Connect circuit, a VPN gateway, or a smart access gateway. This method is not suitable for individual users because of high expenses.
- Expose the service port of the database to the Internet. This method poses potential risks to data security.
- Use a self-managed proxy to forward service requests. This method compromises service stability and requires technical expertise.
DG allows you to connect external databases to Alibaba Cloud without the need to expose the endpoints of these databases to the Internet. After you connect external databases to Alibaba Cloud through DG, you can find them in Data Management (DMS). DG also encrypts data transmission and supports simple configurations that do not require firewalls. For more information, see What is Database Gateway?.
- Create a database gateway. For more information, see Create a database gateway.
- Add the external database that you want to connect to Alibaba Cloud. For more information,
see Add databases. DG is free of charge. However, you must make sure that the following requirements are met when you use DG:
- The server where the database gateway is deployed has Internet access. You do not need to expose the service port to the Internet. To support stable and fast data transmission, make sure that the public bandwidth of the database gateway for outbound data transfer is 10 Mbit/s or higher.
- The server where the database gateway is deployed can connect to the external database. If you require a lower network latency, deploy the server and external database in the same internal network.
- In the following steps, a migration task created in DTS is used as an example. Log
on to the DTS console. In the left-side navigation pane, click Data Migration. On the page that appears, click Create Migration Task in the upper-right corner.
- In the Create Migration Task wizard, specify the database information. To specify
an external database as the source or destination database, select Database without public IP:Port (Accessed through database gateway) from the Instance Type drop-down list in the Source Database or Destination Database
section, and then select the endpoint of the external database. Note If you select Database without public IP:Port (Accessed through database gateway) as the instance type when you create a data migration task, the source and destination databases must be deployed in the same region.
- After you specify the database information, click Test Connectivity to verify the connectivity. Then, click Set Whitelist and Next in the lower-right corner to proceed with the migration type and advanced settings.