Backup Modes (New)

Last updated: 2019-09-26 16:07:10

PDF

Backup Overview

Backup Modes

TencentDB for MySQL High-Availability Edition supports auto backup and manual backup of databases.

Backup Types

TencentDB for MySQL High-Availability Edition supports two backup types:

  • Physical backup, which is a full copy of physical data (supported for both auto backup and manual backup).
  • Logical backup, which backs up SQL statements (only supported for manual backup).
  • To restore a database from a physical backup, you need to use xbstream to decompress the package first.
  • If the number of tables in a single instance exceeds one million, backup may fail, and database monitoring may be affected. Please control the number of tables in one single instance appropriately and make sure that it is below one million.
  • As the data of tables created by the MEMORY storage engine is stored in the memory, physical backups cannot be created for such tables. To avoid data loss, it is recommended to replace them with InnoDB tables.
Physical Backup Advantages Logical Backup Disadvantages
  • High backup speed.
  • Streaming backup and compression are supported.
  • High success rate.
  • Simple and efficient restoration.
  • Faster backup-based coupling operations such as adding real-only and disaster recovery instances.
  • 1/8 of average time needed for creating a logical backup.
  • 10 times faster than logical backups during import.
  • Long time needed to restore as it takes time to run SQL and build indexes.
  • Low backup speed, especially when there are massive amounts of data.
  • Possible increase in master-slave delay due to the pressure on instances during backup
  • Possible loss of precision information of floating points.
  • Potential backup failures due to wrong views and other problems.
  • Slower backup-based coupling operations such as adding read-only and disaster recovery instances.
  • Backup Objects

    Data Backup Log Backup
    MySQL v5.5, 5.6, and 5.7 (High-Availability Edition):
  • Auto backup supports full physical backup.
  • Manual backup supports full physical backup, full logical backup, and single-database/table logical backup.
  • Both auto backup and manual backup can be compressed and downloaded.
  • Auto backups cannot be manually deleted, but their retention periods can be set.
  • Manual backups can be manually deleted and will be retained until they are deleted.
  • MySQL v5.5, 5.6, and 5.7 (High-Availability Edition):
  • Log files occupy the instance's backup capacity.
  • Log files can be downloaded but cannot be compressed.
  • Retention periods can be set for log files.
  • Precautions

    • Starting from February 26, 2019, the auto backup feature of TencentDB for MySQL will only support physical backup (default type) and no longer provide logical backup. Existing automatic logical backups will be switched to physical backups automatically.
      This will not affect your business access, but may have impact on your auto backup habit. If you need logical backups, you can use the manual backup method in the TencentDB for MySQL Console or call the relevant API to generate logical backups.
    • Both logical and physical backup files will be compressed, so some files may be unusable after being downloaded. In that case, you can use the table backup function in manual logical backup. For more information, see manual backup.
    • Instance backup files occupy backup capacity, which is currently free of charge. If backup capacity is charged, we will inform you in advance. Please develop a backup schedule and plan the backup capacity appropriately to avoid potential extra fees in the future.
    • It is recommended to back up your database during off-hours.
    • To avoid situations where the required backup files are deleted after the retention period lapses, please download them to the local file system in a timely manner.
    • DDL operations are prohibited during the backup process so as to avoid backup failure due to table locking.

    Backing up MySQL Data Automatically

    1. Log in to the TencentDB for MySQL Console, click an instance name on the instance list page to enter the management page, and select Backup and Restore > Auto Backup Settings.

      If this feature is not displayed in your console, please submit a ticket for application.

    2. Select backup parameters in the pop-up window as detailed below and click OK:
      Parameter Description
      Backup initiation time
      • You can customize a time range as needed and are recommended to back up your database during off-hours.
      • The default backup initiation time is automatically assigned by the system. This is just the start time of the backup process and does not indicate the end time.
        For example, if the time range is 02:00-06:00, the system will initiate a backup at a point in time during 02:00-06:00, which depends on the backend backup policy and backup system conditions.
      Data backup retention period
      • Data backup files can be retained for 7 (default value) to 732 days (backup capacity is currently available free of charge).
      • If backup capacity is charged, we will inform you in advance.
      Log backup retention period
      • Log backup files can be retained for 7 (default value) to 732 days (backup capacity is currently available free of charge). The number of days set for log backup retention must be smaller than that for data backup retention.
      • If backup capacity is charged, we will inform you in advance.

    Backing up MySQL Data Manually

    The manual backup feature allows you to initiate a backup task manually.

    • Manual backup supports full physical backup, full logical backup, and single-database/table logical backup.
    • Frequent manual backup will increase the backup capacity. Please plan the backup capacity appropriately. If backup capacity is charged, we will inform you in advance.
    • You can delete manual backups to release backup capacity.
    1. On the instance list page, click an instance name to enter the management page, and select Backup and Restore > Manual Backup.

      If this feature is not displayed in your console, please submit a ticket for application.

    2. Select backup modes and objects in the pop-up window and click OK.

      For logical single-database/table backup, select the database or table to be backed up in Select database & table in the left column and add the selected item to the right column. If you don't have a database, please create a database/table first.