×
Community Blog Really Worth it? How Does ApsaraDB for RDS and an User-Created MySQL Database Compare

Really Worth it? How Does ApsaraDB for RDS and an User-Created MySQL Database Compare

Host a database of your own or purchase one of Alibaba Cloud's databases? Which has better performance? Read on to find out.

1

Cloud in many ways is the driving force behind several technological innovations, and is the element that facilitates the building of IT infrastructure nowadays. Among other products and services in the cloud, cloud databases are an important cloud product and used by a large portion of customers.

Interestingly, though, we found that our customers tend to use cloud databases in one of either two ways. They will either create a database on an Alibaba Cloud server, or directly purchase a database service provided by Alibaba Cloud, such as ApsaraDB for RDS. But, what is the real difference between these two options? How can users, or how should users, choose between them?

This article attempts to answer the age-old question: is buying database services really worth it in the end? To answer this question, we did a series of tests in two different scenarios to find the results to let you see the clear answer to this question.

Test Overview

The tests outlined in this post compare the performance of a MySQL 5.7 or 8.0 database based on an Alibaba Cloud ECS instance and a general-purpose ApsaraDB for RDS instance in the Online Transaction Processing (OLTP) read/write hybrid model. These tests use the standard Sysbench 1.0 tool and a database with 4 CPU cores and 16 GB memory, which represents the most commonly used specification. Specifically, the innodb_buffer_pool_size configuration is 12 GB.

Test Scenarios

We tested the following three scenarios:

  • Memory hit: For this scenario, 150 tables are available, and each table contains about 2 GB of data in 25,000 lines. In this test, the CPU is the first thing to encounter a bottleneck.
  • Small-scale I/O: In this second scenario, 150 tables are available, and each table contains about 50 GB of data in 1.2 million lines. In this test, it's the CPU again that is the first thing to encounter a bottleneck.
  • Large-scale I/O: In this last scenario, 150 tables are available, and each table contains about 200 GB of data in five million lines. For this test, the IOPS part is first to encounter a bottleneck.

Test Conclusions

  • When the CPU reaches its bottleneck first, the general-purpose RDS instance performs much better than the ECS-based user-created instance with local SSDs.
  • When the IOPS reaches its bottleneck first, the general-purpose RDS instance performs slightly better than the ECS-based user-created instance with local SSDs.
  • In all the three scenarios, the general-purpose RDS instance performs better and has greater stability than the ECS-based user-created instance with local SSDs.

Test Environment

Test type Test configuration ECS specification Storage MySQL
ECS-based user-created instance with ESSDs 4-core CPU and 16 GB of memory ecs.g6.xlarge Two ESSDs PL1 300 GiB (16,800 IOPS) Open-source MySQL 5.7.27
ECS-based user-created instance with local SSDs 4-core CPU and 16 GB of memory ecs.i2.xlarge Local NVMe SSD: 894 GiB Open-source MySQL 8.0.18
General-purpose RDS instance with local SSDs 4-core CPU and 16 GB of memory Local SSD, maximum IOPS: 7,000
  • The ECS-based user-created MySQL database uses the primary/secondary architecture.
  • The RDS instance uses 4 CPU cores, 16 GB of memory, and local SSDs. It is a high-availability general-purpose instance built on the primary/secondary architecture.
  • The ECS-based user-created MySQL database and the RDS instance use the same configuration template.

Test Data (Scenario: Memory Hit)

MySQL 5.7 High-performance Parameter Template

2

  • The RDS instance performs better than the ECS-based user-created MySQL database under different concurrency conditions.
  • The RDS instance performs much better at low concurrency (concurrency was 16). Its queries per second is 87% higher than that of the ECS-based user-created instance with local SSDs.
  • Open-source MySQL does not have the thread pool feature and has high jitter at high concurrency.

MySQL 8.0 High-performance Parameter Template

3

  • The RDS instance performs better than the ECS-based user-created MySQL database under different concurrency conditions.
  • The RDS instance performs much better at low concurrency (concurrency was 16). Its QPS is 70% higher than that of the ECS-based user-created instance with local SSDs.
  • Open-source MySQL does not have the thread pool feature and has high jitter. It is also almost unavailable at high concurrency.

Test Data (Scenario: Small-scale I/O)

MySQL 5.7 High-performance Parameter Template

4

  • The RDS instance performs better than the ECS-based user-created MySQL database under different concurrency conditions.
  • The RDS instance performs much better at low concurrency (concurrency was 16). Its QPS is 107% higher than that of the ECS-based user-created instance with local SSDs.
  • Open-source MySQL does not have the thread pool feature and has high jitter at high concurrency.

MySQL 8.0 High-performance Parameter Template

5

  • The RDS instance performs better than the ECS-based user-created MySQL database under different concurrency conditions.
  • The RDS instance performs much better at low concurrency (concurrency was 16). Its QPS is 82% higher than that of the ECS-based user-created instance with local SSDs.
  • Open-source MySQL does not have the thread pool feature and has high jitter. It is also almost unavailable at high concurrency.

The CPU Reaches Its Bottleneck First

6

  • The CPU of the RDS instance is fully occupied when the concurrency is 16. The IOPS does not reach its bottleneck throughout the stress testing process.
  • The monitoring information of the ECS-based user-created instance with local SSDs shows that the IOPS remains about 3,000, with the peak reads at 3,000 and peak writes at 6,000.

Test Data (Scenario: Large-scale I/O)

MySQL 5.7 High-performance Parameter Template

7

  • The RDS instance performs better than the ECS-based user-created MySQL database under different concurrency conditions.
  • The IOPS of the RDS instance reaches its bottleneck first. Throughout the stress testing process, the QPS of the RDS instance is only about 10% higher than that of the ECS-based user-created instance with local SSDs.
  • The performance disadvantage of ECS + ESSD becomes apparent at high IOPS levels.
  • Open-source MySQL does not have the thread pool feature and has high jitter at high concurrency.

IOPS reaches its bottleneck first

8

  • The CPU of the RDS instance is never fully occupied during stress testing. The IOPS reaches its bottleneck, and physical reads hold steady at about 6,000.

9

  • The IOPS of the ECS-based user-created instance with local SSDs exceeds the limit (7,000) of the RDS instance.
  • The CPU of the ECS-based user-created instance can be fully occupied.

MySQL 8.0 High-performance Parameter Template

10

  • The RDS instance performs reliably under high I/O stress.
  • The IOPS of the RDS instance reaches its bottleneck first. During stress testing, the QPS advantage of the RDS instance over the ECS-based user-created instance with local SSDs is smaller than that in the preceding scenario.
  • When the IOPS is high, the performance of ECS + ESSD degrades significantly.
  • The performance of open-source MySQL 8.0 falls significantly at high IOPS levels.

Summary

So, to summarize things, our test data definitively shows that Alibaba Cloud's RDS database instance performs much better than the user-created ECS-based databases. In many ways, this is the result of Alibaba Cloud's painstaking research and practical efforts in optimizing our database products over years. Of course, users must consider several factors rather than only performance when selecting databases. Here's the following table for your reference.

ApsaraDB for RDS User-created MySQL database
Performance High Medium-high
Basic features Yes Yes
Peripheral features Yes N/A*
Availability Yes* N/A
Maintenance costs Low Medium
Time cost Low Medium
Financial cost Medium Medium
Autonomy Medium High
  • ApsaraDB for RDS has the advantage that it is intrinsically highly available, and a user-created database has the disadvantage that it must be maintained by the user manually.
  • For a user-created database, another disadvantage is that the user must build peripheral features such as monitoring, backup, and optimization operations.
  • One advantage for user-created databases is that they have high autonomy and can be thoroughly customized by the user.

How Can I Obtain a High-performance Parameter Template

On the Instance Configuration page that appears when you purchase an ApsaraDB for RDS instance, select High-performance Parameter Template as shown in the screenshot of the console below.

11

0 0 0
Share on

ApsaraDB

451 posts | 97 followers

You may also like

Comments