Skip to main content

Use Aiven for MySQL® incremental backups

Enable incremental backups for your Aiven for MySQL® service to back up only what changed since the last full backup, check the type of each stored backup, and follow a restore through the backup chain.

The Aiven for MySQL® incremental backups feature is an extension of the base backups feature. It allows you to back up only the changes (increments) made since your last full backup. While full backups provide a complete snapshot of your database at a specific point in time, incremental backups capture the differences that have occurred between these full snapshots. This feature calculates the difference between the last full backup and the current state of your Aiven for MySQL database and stores it. During a restore, the full backup is applied first, followed by each incremental backup in order, reconstructing your database to the desired point in time.

Use incremental backups for:

  • Reduced DDL lock times: For large databases, full backups can cause prolonged DDL (Data Definition Language) locks. Incremental backups significantly reduce this lock duration, especially when there haven't been many changes.
  • Efficient storage: Databases with fewer changes will benefit from less storage consumption, as incremental backups only store the differences, leading to more efficient use of your storage.
note
  • Restoring from incremental backups might take more time than restoring from a full backup.
  • Incremental backups reduce DDL lock duration, but they don't eliminate DDL locks.

Prerequisites​

  • Access the Aiven Console or the Aiven API.
  • Decide which days of the week to take full backups on. Setting full_backup_week_schedule is required when you enable incremental backups.

Enable incremental backups​

  1. Access your Aiven for MySQL service in the Aiven Console.
  2. In the sidebar, click Service settings.
  3. Scroll to the Advanced configuration section and click Configure.
  4. In the Advanced configuration window, click Add configuration option.
  5. Use the search bar to:
    1. Find mysql_incremental_backup, and set it to Enable.
    2. Find mysql_incremental_backup.full_backup_week_schedule, and set it to a string of any number of the following comma-separated values: mon, tue, wed, thu, fri, sat, sun.
  6. Click Save configuration.

Disable incremental backups​

  1. Access your Aiven for MySQL service in the Aiven Console.
  2. In the sidebar, click Service settings.
  3. Scroll to the Advanced configuration section and click Configure.
  4. In the Advanced configuration window, click Add configuration option.
  5. Use the search bar to find mysql_incremental_backup, and set it to Disable.
  6. Click Save configuration.

Identify full and incremental backups​

With incremental backups enabled, your service stores a chain of backups: a full backup taken on one of the days in full_backup_week_schedule, followed by the incremental backups taken until the next full backup. Check the type of each stored backup to see how your chain is built.

  1. Access your Aiven for MySQL service in the Aiven Console.
  2. In the sidebar, click Backups.
  3. Check the Backup type column, which shows Full or Incremental for each backup in the list.

Follow a restore through the backup chain​

When a node is restored from a chain of backups, the full backup is applied first, and then each incremental backup in order. While the restore runs, you can see which backup in the chain is being applied.

In the Aiven Console, the service status shows a progress bar for the position in the backup chain, in addition to the progress bar for the current restore phase.

In the Aiven API, each entry in node_states[].progress_updates[] can include a position object with the following fields:

  • backup_name: Name of the backup currently being restored. It matches the name in the service backup list.
  • backup_incremental: Whether the backup currently being restored is an incremental one.
  • chain_index: Position of that backup in the restore chain, starting from 1.
  • chain_total: Total number of backups in the restore chain.
note

The position object is reported only when the service has chain information available. Restores without it don't include the object.

For the complete restore progress data model, see Track restore progress.

Related pages