Data is the core asset of an enterprise. As business grows, enterprise data exhibits large-scale and explosive growth, while business applications require real-time, online, and rapid processing. For database Ops personnel, the task of protecting enterprise core data is becoming increasingly challenging. For example, data loss can be caused by factors such as accidental deletion, related system vulnerabilities and viruses, hardware failures, or even natural disasters. Therefore, backup and roll back are very important database features.
Backup Overview
TDSQL-C for MySQL supports data backup and log backup (binlog backup and redolog backup). A complete data backup combined with subsequent log backups allows you to restore the entire TDSQL-C for MySQL cluster or specific databases or tables to any point in time.
The console page for backup and rollback is as follows:
Data Backup
Data backup creates a backup file from the full data of a cluster at a specific point in time. TDSQL-C for MySQL data backup supports two backup types: logical backup and snapshot backup. A logical backup is a full backup, while a snapshot backup includes both full and incremental backups.
Logical backup: It supports only full backup. It saves the logical structure and content of a database, representing the database structure and data in the form of SQL statements. It is an object-level backup, with its backup content including database objects such as tables, indexes, and stored procedures. Its advantages mainly include supporting more granular database- and table-level backups and having a smaller impact on database performance. However, its backup speed is relatively slower, and it occupies more storage space.
Snapshot backup: It uses the Redirect-On-Write (ROW) technology and performs backup by creating snapshots of storage-layer disks. Its advantages mainly include fast backup speed, which can be completed in seconds, no impact on the business at the computing layer during the entire process, and relatively small storage space usage.
Full backup: A complete copy of all data at a specific point in time.
Incremental backup: It backs up files that are newly added or changed, based on the previous backup.
Backup Type Comparison Table
|
Logical backup | Full backup | Advantages: Fine-grained database and table-level backup with minimal impact on database performance. Disadvantages: Locks the database, has a slower backup speed, and occupies a larger volume. | Tables, indexes, stored procedures, and other database objects Entire cluster | Manual | ✓ | ✓ |
|
|
|
| Automatic | ✓ | × |
Snapshot backup | Full backup | Advantages: Backup speed is at the second level, business is not affected, and occupied volume is small. Disadvantages: Backup does not support download. | Entire cluster | Manual | × | × |
|
|
|
| Automatic | × | × |
|
|
| Incremental backup | Automatic | × | × |
Log Backup
|
binlog backup | Incremental backup | Strengths: Incremental data is recorded, allowing restoration to any point in time through binlog backup. Shortcomings: Enabling binlog backup reduces instance write performance. | Entire cluster | Automatic | ✓ | x |
Redolog backup | Incremental backup | Strengths: Physical changes to data pages are recorded for crash recovery, ensuring transaction durability. Shortcomings: Continuous redolog backup increases disk I/O pressure. | Entire cluster | Automatic | x | x |
Log backup is the incremental data generated after a full backup file of the cluster is created at a specific point in time. TDSQL-C for MySQL generates a large number of binlogs when executing large transactions or a high volume of DML operations. The binlog backups are uploaded to cloud storage and displayed in the binlog backup list in the console. Binlog backups are used to store operation logs.
TDSQL-C for MySQL no longer relies on binlog backups for rollback. Instead, it uses redo logs for rollback. Even when binlog is disabled, you can still roll back to any point in time normally. Disabling binlog can improve the write performance of an instance by more than 30%.
Note:
The network architecture of TDSQL-C for MySQL is currently being upgraded gradually. After the upgrade is completed, the feature to disable binlog will be made available.
Cross-Region Backup
TDSQL-C for MySQL provides a cross-region backup feature, supporting the storage of backup files in another region. This helps users enhance compliance and disaster recovery capabilities while improving data reliability. Currently, automatic logical backups, binlog backups, and manual logical backups (entire cluster) support the cross-region backup feature.
Note
Manual backup tasks are limited to a frequency of once per hour. Automatic backup tasks are performed based on the backup start time set by the user. By default, the system performs an automatic backup once per day.
For manual backups, logical backup files can be manually deleted from the backup list to release backup space and avoid waste and occupation. If not manually deleted, backup files remain in the backup list. To avoid waste, periodically delete the parts you do not need.
For automatic backups, files cannot be manually deleted. You can set the retention period for automatic backups to enable automatic deletion upon expiration.
The size of a binlog backup can be queried in the log backup list. The total size of binlog backups is the sum of the sizes of each binlog backup file.
Rollback Overview
TDSQL-C for MySQL supports the rollback feature to restore data to a specified point in time, which can minimize system loss to the greatest extent.
TDSQL-C for MySQL supports rolling back databases or tables to the original cluster and rolling back (cloning) the entire cluster to a new cluster. Users can select different rollback methods based on their business needs.
Note:
For database-level rollbacks, the following object types are not imported: foreign key constraints, check constraints, triggers, stored procedures, user views, and events.
Rollback Method
Rollback from a backup file: Restore the cluster to the data file state of any backup file. The range of backup files available for selection is determined by the data backup retention period set by the user.
Point-in-time rollback: Restore the cluster to any point in time. The range of time points available for selection is determined by the binlog and redolog backup retention periods set by the user.
Backup and Rollback Fees
Backup Storage Space: Backup files consume storage space. Backup methods include automatic backup and manual backup, and backup types include log backup and data backup. The space used by all these backup files is included in this billable item. For details on usage and pricing, see Backup Space Billing Description. Rollback: TDSQL-C for MySQL supports rolling back to the original cluster or to a new cluster based on a backup file or a point in time. Rolling back to the original cluster does not incur additional charges. For a rollback to a new cluster, the new cluster starts being billed after the rollback succeeds. For details on pricing, see Product Pricing.