Help Center/ Domain Name Service/ Best Practices/ Best Practices for Private Domain Name Resolution/ Migrating an Enterprise Service Database to the Cloud
Updated on 2025-08-27 GMT+08:00

Migrating an Enterprise Service Database to the Cloud

Scenarios

The service database migration is the most difficult technical challenge when enterprises move to the cloud. Generally, database domain names are hardcoded in customers' application code and may use irregular or non-real suffixes. To migrate on-premises databases to RDS, customers need to modify the service code. This increases the migration complexity and brings high implementation risks.

Solution Overview

Huawei Cloud private zones support custom domain names and suffixes to seamlessly match offline database domain names. Private domain names are isolated using VPCs to ensure that services in different VPCs do not affect each other. On Huawei Cloud DNS, you can create a private domain name that is the same as that of the on-premises service database and add a CNAME record to map it to the private domain name allocated by RDS. You do not need to modify the client code when migrating databases to the cloud. This reduces the application reconstruction workload and migration risks.

Resource and Cost Planning

The following table lists the resources required for database migration.

Table 1 Resources and costs

Resource

Resource Name

Description

Quantity

Cost

DNS

Private zone

The value must be the same as the service domain name of the on-premises database.

This practice uses db.example.com as an example.

1

Free

Record sets for a private zone

  • Type: CNAME
  • Value: Enter the private domain name automatically generated by RDS.

1

Free

RDS

Cloud database

Used for migrating on-premises data to the cloud.

This practice uses RDS for MySQL as an example. The default private domain name is as follows:

Instance ID.internal.Region ID.mysql.rds.myhuaweicloud.com

1

For details, see RDS Pricing Details.

ECS

ECS

An ECS in the same VPC as the private zone is used for testing domain name resolution.

1

For details, see ECS Pricing Details.

VPC

VPC

The private zone, RDS DB instance, and ECS are associated with the same VPC.

1

Free

Process of Configuring Private Domain Name Resolution for the Cloud Database

Procedure

  1. Obtain the private domain name of the target cloud database.
    1. On the RDS console, go to the Instances page.
    2. In the instance list, click the target instance name.
    3. On the instance overview page, view and record the private domain name.

      Use RDS for MySQL as an example. The default private domain name is as follows:

      Instance ID.internal.Region ID.mysql.rds.myhuaweicloud.com

  2. Create a private zone.
    1. Go to the Private Zones page.
    2. Click in the upper left corner and select the desired region and project.
    3. In the upper right corner of the page, click Create Private Zone.
      Configure the key parameters as follows:
      • Domain Name: Set it the same as the private domain name of the on-premises service database. In this practice, set it to db.example.com.
      • Region: Select the same region as that of the cloud database.
      • VPC: Select the same VPC as that associated with the cloud database.

      Retain the default values for other parameters.

      Figure 1 Creating a private zone
    4. Click OK.
  3. Add a record set.
    1. In the private zone list, click db.example.com.
    2. Click Add Record Set above the record set list.

      Configure the key parameters as follows:

      • Name: Leave this parameter blank, indicating that the domain name to be resolved is db.example.com.
      • Type: Select CNAME-Map one domain to another.
      • Value: Enter the private domain name of the cloud database recorded in 1.c.

      Retain the default values for other parameters.

      Figure 2 Adding a CNAME record set
    3. Click OK.

Verifying Domain Name Resolution

Log in to the ECS and run nslookup domain name.

Example: nslookup db.example.com

In the command output, if the returned result is the same as the domain name configured for the CNAME record set, the record set has taken effect.