ApsaraDB RDS for MySQL compresses data and system logs at the storage layer, reducing storage costs by up to 50%.
Overview
Storage compression is disabled by default. After you enable it, storage costs decrease by up to 50%, and the writable data capacity increases up to 2.5 times. For example, a 100 GB instance can store up to 250 GB of data with compression enabled. Actual results depend on your business requirements.
Storage compression applies to table data and log files such as transaction logs. It reduces disk usage for business data generated in daily operations and logs used for recovery and audit.
Storage compression has minimal impact on instance performance, as shown in the Appendix: Stress testing of the storage compression performance.
How it works
ApsaraDB RDS for MySQL uses an intelligent transparent compression disk developed by Alibaba Cloud, with a dedicated chip that compresses and decompresses data in real time at a level equivalent to zlib Level 6. The process is fully transparent to applications, which prevents compatibility issues. Transparent compression reduces data migration within the disk and effectively reduces disk write amplification. Compared with traditional software compression, it delivers higher efficiency and lower storage costs with minimal performance impact.
Billing rules
Enabling storage compression changes the storage capacity billing formula and the free backup storage quota.
Storage fees are based on the physical data size after compression.
Storage capacity fee
Enabling storage compression changes the storage capacity fee formula.
|
Storage compression status |
Formula for storage capacity fees |
|
Disabled |
Unit price of storage capacity × Storage capacity × Usage duration |
|
Enabled |
1.25 × Unit price of storage capacity × Storage capacity × Usage duration |
Enabling storage compression incurs a price difference. Fees in the ApsaraDB RDS console prevail. For subscription instances, this is a configuration upgrade order. For pay-as-you-go instances, this is a specification change order. The billing logic follows the standard specification change process.
Free quota on backup storage
No fees are charged if your backup files stay within the free quota (Backup size). Excess backup storage is billed hourly: Hourly fee for backup storage = (Total size of backup files - Free quota) × Unit price of backup storage.
Billing details: Billing for regular and archived backups. Unit prices: RDS Pricing.
|
Storage type |
Storage compression status |
Free quota |
Description |
|
Premium Enterprise SSD (ESSD) |
Disabled |
The free quota is equal to 200% of the storage capacity that you purchase for your RDS instance. |
On the instance's Basic Information page, in the Usage Statistics section, view the Backup Usage parameter (the actual logical data size). |
|
Enabled |
The free quota is equal to 400% of the storage capacity that you purchase for your RDS instance. |
||
|
Premium Local SSD |
Disabled |
The free quota is equal to 50% of the storage capacity that you purchase for your RDS instance. |
|
|
Enabled |
The free quota is equal to 100% of the storage capacity that you purchase for your RDS instance. |
Backups contain the uncompressed user data.
Prerequisites
The RDS instance meets the following requirements:
-
The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6.
-
The RDS instance runs RDS High-availability Edition or RDS Cluster Edition.
-
The RDS instance uses a dedicated instance type.
-
The RDS instance uses Premium ESSDs or Premium Local SSDs.
-
Storage capacity: 1,000-25,000 GB for Premium ESSDs, or 1,000-2,400 GB for Premium Local SSDs.
-
The RDS instance uses the subscription or pay-as-you-go billing method.
Limits
-
Storage compression cannot be disabled after it is enabled.
-
If you enable the storage compression feature for your RDS instance, the following limits are imposed on specification changes:
-
Dedicated instance types cannot be changed to general-purpose types.
-
Pay-as-you-go billing cannot be changed to serverless.
-
Premium Local SSD storage cannot be changed to cloud disk.
-
Storage capacity cannot be reduced below 1,000 GB.
-
Elastic upgrades are not supported for cloud disk instances.
-
-
Read-only RDS instances: You must enable storage compression on read-only instances before enabling it on the primary instance (MySQL read-only instances). New read-only instances attached to a compression-enabled primary instance inherit this setting automatically.
-
Backup and restoration:
-
Backups contain the uncompressed user data.
-
Backup data is not compressed. However, you can enable storage compression on instances restored from backups (Backup and restoration).
-
-
Recycle bin: Instances restored from the recycle bin inherit the storage compression setting of the original instance (Instance recycle bin).
Enable storage compression
-
Log on to the ApsaraDB RDS console. On the Instances page, select the region of your RDS instance and click the instance ID.
-
On the Basic Information page, in the Configuration Information section, click Enable Storage Compression.
NoteIf the button is not displayed, verify that your RDS instance meets the Prerequisites.
-
In the Enable Storage Compression dialog box, read the notes and click OK.
-
Click OK. The instance status changes to Upgrading/Downgrading. When Enabled appears for storage compression in the Configuration Information section, the feature is active.
FAQ
How do I view disk space metrics after enabling storage compression?
A: Go to the Standard Monitoring tab on the Monitoring and Alerts page. The MySQL Storage Space Used (MB), Disk Usage (%), and MySQL Physical Storage Space Used (MB) metrics show disk space usage (View monitoring information).
Appendix: Storage compression performance benchmarks
This section compares instance performance before and after enabling storage compression.
-
Test environment
-
Application server: an Alibaba Cloud Elastic Compute Service (ECS) instance
-
RDS instance specifications: RDS High-availability Edition and a dedicated instance type that provides 8 cores and 32 GB of memory
-
Storage type: Premium ESSD with I/O performance burst enabled
-
Storage capacity: 1,000 GB
-
-
Test case
The following sysbench test cases were used:
-
oltp_read_only
-
oltp_read_write
-
oltp_write_only
Sample command:
sysbench oltp_write_only --mysql-host=xxxxxx --mysql-port=xxxxxx --mysql-user=xxxxxx --mysql-password=xxxxxx --tables=12 --table_size=4000000 --report-interval=1 --mysql-db=xxxxxx --rand-type=uniform --threads=1 --time=100 run -
-
Test results
-
The following figure shows the results for a 12 GB dataset.

Concurrency
oltp_read_only
oltp_read_write
oltp_write_only
Before compression
After compression
Increase ratio
Before compression
After compression
Increase ratio
Before compression
After compression
Increase ratio
1
6738.05
6534.69
-3%
4698.92
4620.96
-2%
3296.62
3151.49
-4%
8
49446.32
48834.86
-1%
30464.41
29389.79
-4%
17935.94
17371.47
-3%
16
79411.76
78639.35
-1%
47852.25
46415.14
-3%
27851.15
27257.97
-2%
32
100070.48
100314.49
0%
68408.67
68521.4
0%
40468.31
39921.37
-1%
64
113637.5
112402.16
-1%
82387.07
82751.29
0%
57843.89
57267.82
-1%
128
113871.22
112133.53
-2%
90124.61
89783.53
0%
69850.39
68477.59
-2%
256
108770.33
107001.19
-2%
88390.16
88001.18
0%
79330.67
79290.03
0%
512
104325.11
102797.59
-1%
85701.04
84782.41
-1%
77186.74
76983.98
0%
-
The following table shows the test results for a 48 GB dataset:

Concurrency
oltp_read_only
oltp_read_write
oltp_write_only
Before compression
After compression
Increase ratio
Before compression
After compression
Increase ratio
Before compression
After compression
Increase ratio
1
1945.09
1902.89
-2%
1700.04
1748.47
3%
1639.68
1722.17
5%
8
15934.45
15155.32
-5%
13049.89
13230.25
1%
12203.44
12518.78
3%
16
32436.32
31072.3
-4%
23130.89
23727.46
3%
20668.33
21196.57
3%
32
56018.88
55409.98
-1%
38182.38
39864.06
4%
30498.33
31356.85
3%
64
72838.53
73459.99
1%
51153.83
51888.1
1%
41560.41
42073.77
1%
128
80598.87
80788.34
0%
58943.65
58837.55
0%
50755.55
51526.62
2%
256
80500.57
80369.96
0%
58969.94
59222.25
0%
56874.2
56512.52
-1%
512
74476.62
74758.1
0%
58756.28
58347.02
-1%
58009.1
58565.04
1%
-