Database Gateway allows you to connect cloud services such as Data Management (DMS), Data Transmission Service (DTS), and Database Backup (DBS) to on-premises databases or third-party cloud databases. Database Gateway also enables database access points. This way, you can connect the applications that are deployed on ECS instances to on-premises databases or third-party cloud databases through a database access point.

Introduction to database access points

Database Gateway provides database access points that can map the endpoints of on-premises databases or third-party cloud databases to the VPC endpoints on Alibaba Cloud. This way, the applications in the VPC can directly connect to the original databases through the VPC endpoints.

Assume that the endpoint of your on-premises database is 10.1.2.3:3306. Your applications deployed on Alibaba Cloud cannot directly connect to the database because the networks between the on-premises database and Alibaba Cloud are not interconnected. However, Database Gateway can create a mapping by using a database access point and generate the VPC endpoint 172.6.7.8:5432. This way, the applications in the cloud can connect to the database through the endpoint 172.6.7.8:5432.

Database access points free you from the technical details of cloud networking, on-premises networking, and cross-cloud networking. This way, the applications deployed on ECS instances can connect to databases in other network environments. This meets your requirements in hybrid cloud scenarios, such as online applications, offline analysis, and data migration.

Prerequisites

  • A local agent is started and a database is added. For more information, see Quick Start.
  • A VPC and a vSwitch are created in the same region where Database Gateway is deployed.

Procedure

  1. Log on to the Database Gateway console.
  2. In the left-side navigation pane, click Gateway List.fdfd
  3. Go to the page that displays the details about the added database. On the page that appears, click Create a database access point in the Operation column.
  4. Select the VPC ID and the vSwitch that you want to use, and click OK. Then, you can use the VPC endpoint to connect to the database.
  5. Log on to an ECS instance that is connected to the VPC and test whether the displayed VPC endpoint is valid. If the connection is successful, you can use methods such as the Java Database Connectivity (JDBC) method to connect to on-premises databases or third-party cloud databases.