As rarely accessed historical data accumulates in your online database, it consumes more storage space and can degrade query performance and impact business operations. You can use the data archiving feature of Data Management (DMS) to periodically archive table data that meets specific filter conditions to other databases or storage services. This feature also supports deleting data from source tables and reorganizing tablespaces to reduce online storage costs.
The data archiving feature is currently in public preview.
Example scenario
In an e-commerce platform, a large volume of order data is generated daily. Over time, this data is accessed less frequently. To improve database performance and reduce storage usage, you can use the DMS data archiving feature to periodically archive this order data.
Notes
The data archiving operation may affect the performance of your services.
ImportantTo minimize the impact, perform the archive operation during off-peak hours.
The archive task may fail if the tables to be archived contain large objects, such as BLOB and TEXT, or rows with a large amount of data.
The data archiving feature is not available in regions outside China.
You cannot archive data from tables that contain virtual columns.
You cannot archive data from a database hosted on a third-party cloud or a self-managed database using the DMS console or an API.
Differences between data archiving in DMS and data migration in DTS
Purpose
Data archiving lets you use custom filter conditions to archive infrequently accessed data to other storage. This reduces the load on the primary database and improves performance.
Data migration moves data between homogeneous and disparate data sources. For more information, see Overview of migration solutions.
Scenarios
Data archiving lets you periodically or immediately archive infrequently accessed data to other databases or storage.
Data migration is suitable for scenarios such as migrating data to the cloud, migrating data between tasks within Alibaba Cloud, and splitting or scaling out databases.
Guide to selecting an archive destination
Engine-based destinations
Comparison Item | Lindorm | AnalyticDB for MySQL 3.0 | AnalyticDB for PostgreSQL | RDS for MySQL | PolarDB for MySQL |
Supported source database types |
Note The MySQL database account must have the REPLICATION CLIENT permission. | ||||
Billing | The data archiving feature is free of charge. Fees are incurred when you purchase a destination instance and the Stable Change or Security Collaboration control mode. | ||||
Deletion of source data after archiving | Supports automatic deletion of source data. This ensures that data archiving and source data deletion are completed in sync, which reduces the hassle and risks of deleting source data later.
| ||||
How to query archived data |
| ||||
Specify archive location |
| ||||
Table schema changes | A new column is added to record the ticket ID, archiving time, and other information. This does not affect data usage. | ||||
Use cases |
|
|
|
|
|
Data control | Strongest. Data is archived to a database instance that you manage. You can flexibly process data by interacting with the database. | ||||
StorageClass
Comparison Criteria | User OSS | DBS built-in OSS (Not recommended) |
Supported source database types |
Note
|
|
Billing | The data archiving feature is free of charge. Fees are incurred when you purchase a Stable Change or Security Collaboration control mode and a destination OSS instance. | DMS creates a backup schedule in DBS. DBS charges fees for backup and storage based on the amount of backed-up data. For more information, see DBS pricing. Note The DBS backup schedule created for data archiving is of the xlarge specification. |
Deletion of source data after archiving | Does not support automatic deletion of source data. You must create a regular data change ticket to clear the archived data from the database. | |
How to query archived data | Supports querying archived data through the DMS logical data warehouse. | - |
Specify archive location | You must specify an OSS bucket. | You do not need to specify an OSS bucket. The system automatically creates a backup schedule in DBS and archives the data to OSS. |
Table schema changes | The table schema does not change. | |
Use cases | Reduce online storage costs (strongest capability). | Reduce online storage costs (strong capability). |
Data control | Strong. Data is archived to an Alibaba Cloud OSS bucket that you own. | Weak. Data is archived to a built-in OSS bucket in DBS. |
Archive link documents
FAQ
Q: If I choose to clear source table data during the data archiving process, can I still query the historical business data?
A: Yes. The data archiving feature archives data to another database. You can query the destination database to access the historical business data.
Q: When I create a data archiving ticket in DMS, the page displays the message "The content is empty, no backup is needed." Why?
A: This message indicates that no data in the database matches the archiving conditions that you configured. Check if your archiving rules are set correctly. After you click Submit, the system generates and displays a preview of the archiving SQL statement based on your configuration. You can run this SQL statement to preview the data range and check the matching results to ensure that your configuration is correct.