This topic describes the issues that you need to consider when you perform a test to compare the performance of a user-created database with that of an ApsaraDB for RDS instance. The user-created database and the ApsaraDB for RDS instance must be compared under the same conditions. These conditions include the network environment, specifications, and database engine version.

In actual business scenarios, you can select your user-created database or purchase an ApsaraDB for RDS instance based on your business requirements. We recommend that you purchase an ApsaraDB for RDS instance. An ApsaraDB for RDS instance is fully hosted. It includes a complete suite of solutions such as security, backup, restoration, scaling, and performance optimization. This allows you to mitigate the need for security and maintenance workloads. For example, you do not need to create secondary databases. You need to focus only on the development and innovation of your business.

For more information about the comparison between a user-created database and an ApsaraDB for RDS instance, see Competitive advantages of ApsaraDB for RDS instances over user-created databases.

Network environment

  • Your application and the user-created database must be deployed on different ECS instances and reside in the same region as the ApsaraDB for RDS instance. This allows you to use the application to communicate with the ApsaraDB for RDS instance and the user-created database over internal networks.
    Note If the application and the user-created database are deployed on the same ECS instance, the network path from the application to the user-created database is shorter than that from the application to the ApsaraDB for RDS instance. In addition, the application occupies CPU resources. These affect the performance of the user-created database. As a result, the test results are compromised and do not show accurate comparison results for the user-created database.
  • You can deploy the application, user-created database, and ApsaraDB for RDS instance by using one of the following architectures:
    • The application, user-created database, and ApsaraDB for RDS instance reside in the same zone.
    • The user-created database and the ApsaraDB for RDS instance reside in the same zone, and the application resides in a different zone within the same region.

Specifications

The ECS instance where the user-created database resides provides the same number of CPU cores and memory capacity as the ApsaraDB for RDS instance.

Database engine version

The user-created database and the ApsaraDB for RDS instance are running the same database engine version. For example, they both are running MySQL 5.6.

Data replication mode

Data can be replicated between the primary and secondary user-created databases or between the primary and secondary ApsaraDB for RDS instances in one of the following modes: asynchronous, semi-synchronous, and synchronous. For more information about the data replication modes, see Modify the data replication mode.

The following table lists the data replication modes that are supported by the user-created database and the ApsaraDB for RDS instance.

User-created database ApsaraDB for RDS instance
No secondary databases are provided, and data replication is not required. Your database system is running the High-availability Edition, and data is replicated in asynchronous mode.
One secondary database is provided, and data replication is in asynchronous mode. Your database system is running the High-availability Edition, and data is replicated in asynchronous mode.
One secondary database is provided, and data is replicated in semi-synchronous mode. Your database system is running the High-availability Edition, and data is replicated in semi-synchronous mode.
Two secondary databases are provided, and data is replicated in synchronous mode. Your database system is running the Enterprise Edition, and data is replicated in synchronous mode. Only the synchronous mode is supported in the Enterprise Edition.

Parameter settings

The user-created database and the ApsaraDB for RDS instance must use the same parameter settings.

For more information about reconfiguring the parameters of an ApsaraDB for RDS instance, see Use the console to set parameters.

Note For security purposes, ApsaraDB for RDS does not allow you to reconfigure certain parameters. If the user-created database and the ApsaraDB for RDS instance have different settings for a parameter and ApsaraDB for RDS does not allow you to reconfigure this parameter, you must reconfigure this parameter for the user-created database.

Use case

Scenario: A customer is migrating their business system from a user-created database in their on-premises data center to an ApsaraDB for RDS instance. The time that is required to execute SQL statements on the ApsaraDB for RDS instance is twice the time that is required in the user-created database.

Cause: The user-created database and the ApsaraDB for RDS instance use different parameter settings. For example:

  • The user-created database uses the following parameter settings:

    join_buffer_size = 128M

    read_rnd_buffer_size = 128M

    tmp_table_size = 128M

  • The ApsaraDB for RDS instance uses the following parameter settings:

    join_buffer_size = 1M

    read_buffer_size = 1M

    tmp_table_size =256K