<description>{[project]} provides fast, reliable backup and restore for {[postgres]} and seamlessly scales to terabyte scale databases by implementing stream compression and parallel processing.</description>
<p>Instead of relying on traditional backup tools like tar and rsync, <backrest/> implements all backup features internally and uses a custom protocol for communicating with remote systems. Removing reliance on tar and rsync allows for better solutions to database-specific backup challenges. The custom remote protocol allows for more flexibility and limits the types of connections that are required to perform a backup which increases security.</p>
<p><backrest/><linkurl="{[github-url-base]}/releases/tag/release/{[version-stable]}">v{[version-stable]}</link> is the current stable release. Release notes are on the <linkpage="{[backrest-page-release]}">Releases</link> page.</p>
<p>Compression is usually the bottleneck during backup operations but, even with now ubiquitous multi-core servers, most database backup solutions are still single-process. <backrest/> solves the compression bottleneck with parallel processing.</p>
<p>Utilizing multiple cores for compression makes it possible to achieve 1TB/hr raw throughput even on a 1Gb/s link. More cores and a larger pipe lead to even higher throughput.</p>
</section>
<sectionid="local-or-remote">
<title>Local or Remote Operation</title>
<p>A custom protocol allows <backrest/> to backup, restore, and archive locally or remotely via SSH with minimal configuration. An interface to query <postgres/> is also provided via the protocol layer so that remote access to <postgres/> is never required, which enhances security.</p>
</section>
<sectionid="backup-types">
<title>Full, Incremental, & Differential Backups</title>
<p>Full, differential, and incremental backups are supported. <backrest/> is not susceptible to the time resolution issues of rsync, making differential and incremental backups completely safe.</p>
</section>
<sectionid="backup-rotation">
<title>Backup Rotation & Archive Expiration</title>
<p>Retention polices can be set for full and differential backups to create coverage for any timeframe. WAL archive can be maintained for all backups or strictly for the most recent backups. In the latter case WAL required to make older backups consistent will be maintained in the archive.</p>
</section>
<sectionid="backup-intregrity">
<title>Backup Integrity</title>
<p>Checksums are calculated for every file in the backup and rechecked during a restore. After a backup finishes copying files, it waits until every WAL segment required to make the backup consistent reaches the repository.</p>
<p>Backups in the repository are stored in the same format as a standard <postgres/> cluster (including tablespaces). If compression is disabled and hard links are enabled it is possible to snapshot a backup in the repository and bring up a <postgres/> cluster directly on the snapshot. This is advantageous for terabyte-scale databases that are time consuming to restore in the traditional way.</p>
<p>All operations utilize file and directory level fsync to ensure durability.</p>
</section>
<sectionid="backup-resume">
<title>Backup Resume</title>
<p>An aborted backup can be resumed from the point where it was stopped. Files that were already copied are compared with the checksums in the manifest to ensure integrity. Since this operation can take place entirely on the backup server, it reduces load on the database server and saves time since checksum calculation is faster than compressing and retransmitting data.</p>
</section>
<sectionid="stream-compression-checksums">
<title>Streaming Compression & Checksums</title>
<p>Compression and checksum calculations are performed in stream while files are being copied to the repository, whether the repository is located locally or remotely.</p>
<p>If the repository is on a backup server, compression is performed on the database server and files are transmitted in a compressed format and simply stored on the backup server. When compression is disabled a lower level of compression is utilized to make efficient use of available bandwidth while keeping CPU cost to a minimum.</p>
<p>The manifest contains checksums for every file in the backup so that during a restore it is possible to use these checksums to speed processing enormously. On a delta restore any files not present in the backup are first removed and then checksums are taken for the remaining files. Files that match the backup are left in place and the rest of the files are restored as usual. Parallel processing can lead to a dramatic reduction in restore times.</p>
<p>Dedicated commands are included for both pushing WAL to the archive and retrieving WAL from the archive.</p>
<p>The push command automatically detects WAL segments that are pushed multiple times and de-duplicates when the segment is identical, otherwise an error is raised. The push and get commands both ensure that the database and repository match by comparing <postgres/> versions and system identifiers. This precludes the possibility of misconfiguring the WAL archive location.</p>
<p>Asynchronous archiving allows transfer to be offloaded to another process which compresses WAL segments in parallel for maximum throughput. This can be a critical feature for databases with extremely high write volume.</p>
<p>Tablespaces are fully supported and on restore tablespaces can be remapped to any location. It is also possible to remap all tablespaces to one location with a single command which is useful for development restores.</p>
<p>File and directory links are supported for any file or directory in the <postgres/> cluster. When restoring it is possible to restore all links to their original locations, remap some or all links, or restore some or all links as normal files or directories within the cluster directory.</p>
</section>
<sectionid="postgres-compatibility">
<title>Compatibility with <postgres/> >= 8.3</title>
<p><backrest/> includes support for versions down to 8.3, since older versions of PostgreSQL are still regularly utilized.</p>
Code fixes or new features can be submitted via pull requests. Ideas for new features and improvements to existing functionality or documentation can be <linkurl="{[github-url-issues]}">submitted as issues</link>. You may want to check the <linkurl="{[github-url-wiki-backlog]}">Feature Backlog</link> to see if your suggestion has already been submitted.
Bug reports should be <linkurl="{[github-url-issues]}">submitted as issues</link>. Please provide as much information as possible to aid in determining the cause of the problem.
<p><backrest/> is completely free and open source under the <linkurl="{[github-url-license]}">MIT</link> license. You may use it for personal or commercial purposes without any restrictions whatsoever. Bug reports are taken very seriously and will be addressed as quickly as possible.
Creating a robust disaster recovery policy with proper replication and backup strategies can be a very complex and daunting task. You may find that you need help during the architecture phase and ongoing support to ensure that your enterprise continues running smoothly.
<linkurl="{[crunchy-url-base]}">Crunchy Data</link> provides packaged versions of <backrest/> for major operating systems and expert full life-cycle commercial support for <backrest/> and all things <postgres/>. <linkurl="{[crunchy-url-base]}">Crunchy Data</link> is committed to providing open source solutions with no vendor lock-in, ensuring that cross-compatibility with the community version of <backrest/> is always strictly maintained.
<p>Primary recognition goes to Stephen Frost for all his valuable advice and criticism during the development of <backrest/>.
<linkurl="{[crunchy-url-base]}">Crunchy Data</link> has contributed significant time and resources to <backrest/> and continues to actively support development. <linkurl="{[resonate-url-base]}">Resonate</link> also contributed to the development of <backrest/> and allowed early (but well tested) versions to be installed as their primary <postgres/> backup solution.</p>
<p><linkurl="https://thenounproject.com/search/?q=lounge+chair&i=129971">Armchair</link> graphic by <linkurl="https://thenounproject.com/sandorsz">Sandor Szabo</link>.</p>