Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

Get free database assistance or contact our experts for personalized support.

Backup compression support in Percona Operator for MySQL

Percona Operator for MySQL uses Percona XtraBackup (PXB) to create backups. The Operator exposes this capability too, supporting compression using the zstd compression algorithm.

Compression works for both full and incremental backups, and you can configure it for scheduled and on‑demand backups.

With this ability to compress backups, you can reduce the size of your backups, and lower storage and data‑transfer costs.

Configure global compression

You can configure compression using the MySQL configuration file. This setting applies to both scheduled and on-demand backups for all backup storages that you use.

spec:
  mysql:
    image: percona/percona-server:8.4.8-8.1
    configuration: |
      ...
      [xtrabackup]
      compress=zstd
      ...

You can override the compression for scheduled backups per specific storage or for a particular on-demand backup.

Configure compression for scheduled backups

In the cluster Custom Resource, add compression flags under the storage entry your schedules use:

spec:
  backup:
    storages:
      <storage-name>:
        containerOptions:
          args:
            xtrabackup: 
              - "--compress"

Configure compression for on‑demand backups

For on‑demand backups, define the compression settings directly in the configuration file for the PerconaServerMySQLBackup object:

apiVersion: ps.percona.com/v1
kind: PerconaServerMySQLBackup
metadata:
  name: backup1-compressed
  finalizers:
    - percona.com/delete-backup
spec:
  clusterName: ps-cluster1
  storageName: s3-us-west
  containerOptions:
    args:
      xtrabackup:
        - "--compress"

It’s important to understand how the Operator prioritizes compression and other backup tool settings when they’re defined both globally in your cluster’s Custom Resource (CR) and individually for a specific backup or restore job. Percona Operator gives precedence to the settings in an individual PerconaServerMySQLBackup or PerconaServerMySQLRestore object, allowing you to override cluster-wide defaults on a per-job basis. For a detailed explanation of how these options apply, see Fine-tuning backup and restore operations.

Restore from a compressed backup

You can make a restore either using the backupName or the backupSource options.

The Operator detects if this backup is compressed and automatically decompresses during the preparation stage for the restore.


Last update: April 17, 2026
Created: April 17, 2026