The xbstream binary¶
To support simultaneous compression and streaming, a new custom streaming format called xbstream was introduced to Percona XtraBackup in addition to the TAR format. That was required to overcome some limitations of traditional archive formats such as tar, cpio and others which did not allow streaming dynamically generated files, for example dynamically compressed files. Other advantages of xbstream over traditional streaming/archive format include ability to stream multiple files concurrently (so it is possible to use streaming in the xbstream format together with the –parallel option) and more compact data storage.
This utility has a tar-like interface:
-xoption it extracts files from the stream read from its standard input to the current directory unless specified otherwise with the
-coption. Support for parallel extraction with the
--paralleloption has been implemented in Percona XtraBackup 2.4.7.
-coption it streams files specified on the command line to its standard output.
--decrypt=ALGOoption specified xbstream will automatically decrypt encrypted files when extracting input stream. Supported values for this option are:
--encrypt-key-fileoptions must be specified to provide encryption key, but not both. This option has been implemented in Percona XtraBackup 2.4.7.
--encrypt-threadsoption you can specify the number of threads for parallel data encryption. The default value is
1. This option has been implemented in Percona XtraBackup 2.4.7.
--encrypt-keyoption is used to specify the encryption key that will be used. It can’t be used with
--encrypt-key-fileoption because they are mutually exclusive. This option has been implemented in Percona XtraBackup 2.4.7.
--encrypt-key-fileoption is used to specify the file that contains the encryption key. It can’t be used with
--encrypt-keyoption. because they are mutually exclusive. This option has been implemented in Percona XtraBackup 2.4.7.
The utility also tries to minimize its impact on the OS page cache by using the
posix_fadvise() calls when available.
When compression is enabled with xtrabackup all data is being compressed, including the transaction log file and meta data files, using the specified compression algorithm. Percona XtraBackup supports the following compression algorithms:
Starting with Percona XtraBackup 8.0.31-24 using qpress/QuickLZ to compress backups is deprecated and may be removed in future versions. We recommend using either
LZ4 or Zstandard (
ZSTD) compression algorithms.
The resulting files have the qpress archive format. Every
produced by xtrabackup is essentially a one-file qpress archive and can be extracted and uncompressed by the
qpress file archiver. This means that there is no need to decompress entire backup to restore a single table as with
To decompress individual files, run xbstream with the
--decompress option. You may control the number of threads
used for decompressing by passing the
Also, files can be decompressed using the qpress tool. The tool supports multi-threaded decompression.
To compress files using the
lz4 compression algorithm, set
--compress option to
$ xtrabackup --backup --compress=lz4 --target-dir=/data/backup
The Zstandard (ZSTD) compression algorithm is a tech preview feature. Before using ZSTD in production, we recommend that you test restoring production from physical backups in your environment, and also use the alternative backup method for redundancy.
Percona XtraBackup 8.0.30-23 adds support for the
Zstandard (ZSTD) compression algorithm.
ZSTD is a fast lossless compression algorithm that targets real-time compression scenarios and better compression ratios.
To compress files using the
ZSTD compression algorithm, use the
--compress=zstd option. The resulting files have the
You can specify
ZSTD compression level with the
--compress-zstd-level(=#) option. The defaul value is
$ xtrabackup --backup --compress-zstd-level=1 --target-dir=/data/backup
To decompress files, use the
For free technical help, visit the Percona Community Forum.
To report bugs or submit feature requests, open a JIRA ticket.
For paid support and managed or consulting services , contact Percona Sales.