In this demo, we will guide you through the data archiving solution available on ApsaraDB RDS, highlighting its advantages and ease of use.
This feature is designed to streamline your data management by efficiently archiving cold data from RDS hot storage to OSS.
Data Archiving on ApsaraDB RDS allows you to automatically archive cold data at the table level.
Once archived, the data becomes read-only, meaning it can only be read and not modified. This ensures that your read requests will not be affected after archiving, and no changes to your applications are necessary.
If you need to modify the archived data, such as inserting or updating, you will first need to perform a data rehydration process to relocate the data back to hot storage. Both archiving and rehydration are simple processes, executable via straightforward SQL commands.
Let's begin by setting up our demo environment. We'll create a test ApsaraDB RDS for MySQL instance containing a table with 1 million records. If you haven't already set up your resources, feel free to follow along. If you do have existing ApsaraDB RDS instances, make sure your instances use General ESSD storage type, as the data archiving feature currently supports only this type.
Once your resources are ready, navigate to the ApsaraDB RDS console, click on the instance ID to view details, check the storage type, and verify if the data archiving feature is enabled. This feature can be toggled on or off at any time, so if it’s disabled, please activate it.
Next, create users and test databases.
After that, log onto the instance via Data Management (DMS) to create test tables and prepare test data.
As shown, we have prepared 1 million data records in the table.
The test environment is now ready. Let's proceed with the demonstration.
Please pay close attention as we execute an ALTER TABLE SQL statement to archive data from hot storage to OSS.
This action will immediately reduce the storage usage of the instance.
Use the SHOW CREATE TABLE command to verify the effect of the ALTER TABLE command.
To monitor storage usage changes, check the Monitoring and Alerts section in the ApsaraDB RDS console. In this scenario, archiving 1 million records resulted in approximately a 10% reduction in storage usage.
Additionally, you can view the archived data size under Cold Data Management on the console, reflecting current OSS consumption. Notably, the data size remains matches the size of the data before archiving.
Next, we'll retrieve data from the archive.
You’ll notice that standard SQL queries still deliver fast response times, highlighting that data archiving doesn't necessitate any code modifications in your applications.
While moving data to cold storage is traditionally thought to impact retrieval performance, our tests on 1 million records show minimal impact that we did not experience significant latency.
However, as mentioned previously, inserting or updating data in archived mode is not supported.
Consequently, any write requests may fail, as demonstrated here.
To modify the data, you'll need to execute data rehydration to bring it back into hot storage.
How do we do this? Don’t worry - it's just as easy!
This process is equally straightforward.
We'll use the ALTER TABLE command once more to perform data rehydration.
Once the data rehydration is complete, you will notice an increase in storage usage.
At this point, you can proceed with data modification operations such as insert, delete, and update.
Finally, verify record changes after write operations.
In this example, the row count increased following a successful insert operation.
Thank you for joining this demo on the data archiving solution in ApsaraDB RDS. We hope you have gained useful insights into how this feature can enhance your data management strategies without disrupting existing workflows. If you have any questions, feel free to ask! And don’t forget to try it out using our free trials!
Integrate ApsaraDB RDS with Grafana for Monitoring via CloudMonitor
ApsaraDB - August 21, 2024
ApsaraDB - August 21, 2024
ApsaraDB - November 17, 2020
ApsaraDB - July 23, 2024
ApsaraDB - August 8, 2024
ApsaraDB - June 19, 2023
An on-demand database hosting service for MySQL with automated monitoring, backup and disaster recovery capabilities
Learn MoreAn on-demand database hosting service for PostgreSQL with automated monitoring, backup and disaster recovery capabilities
Learn MoreApsaraDB RDS for MariaDB supports multiple storage engines, including MySQL InnoDB to meet different user requirements.
Learn MoreAn on-demand database hosting service for SQL Server with automated monitoring, backup and disaster recovery capabilities
Learn MoreMore Posts by ApsaraDB