liveBook · Manning

Barman

As explained in PostgreSQL Mistakes and How to Avoid Them

Barman is an open-source backup and disaster-recovery tool for PostgreSQL.

Barman is an open-source PostgreSQL backup and disaster-recovery tool. It replaces error-prone manual backups with scheduled, monitored automation and supports continuous WAL archiving for Point-in-Time Recovery (PITR). section 9.3

A typical deployment uses Barman to pull base backups with pg_basebackup and receive WAL through a replication connection. It can also configure archive_command to transfer WAL with rsync, including parallel transfer for high WAL volume. section 9.3

Use Barman with these operational safeguards:

  • Schedule backups rather than relying on operators to remember them. section 9.3
  • Combine physical base backups with continuous WAL archiving; logical backups cannot provide PITR with WAL files. section 9.3
  • Keep a redundant backup copy in another location and perform a complete restore test. section 9.7
  • Monitor automation and verify each step instead of trusting homegrown scripts or untested success reports. section 9.3 section 9.7

A safer production pattern

A PostgreSQL cluster sends base backups and WAL to a dedicated Barman server, while a second location provides geographical redundancy. During recovery, the retained base backup and archived WAL can restore the database to a point before damage occurred. section 9.3 section 9.7

Figure 9.2 A sample PostgreSQL backup setup with a dedicated Barman server and geographical redundancy showing the possible transfer paths
figure

Use the architecture diagram to trace base-backup and WAL-transfer paths between PostgreSQL, Barman, and redundant storage locations. section 9.3

How PostgreSQL Mistakes and How to Avoid Them covers it

How deep it goes
Explains deployment patterns and operational safeguards, but does not provide detailed configuration syntax or restore commands.
Examples
Uses a dedicated Barman server, pg_basebackup, replication-based WAL transfer, rsync, and geographically redundant backup storage.
What it assumes
Assumes PostgreSQL backup fundamentals, while distinguishing physical backups, logical backups, WAL archiving, and PITR.
What you can do after
Operate/configure automated PostgreSQL backups with base backups, continuous WAL archiving, monitoring, redundancy, and restore testing.
How it connects
Connects Barman with PostgreSQL physical backups, pg_basebackup, WAL archiving, PITR, rsync, replication, and backup redundancy.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of PostgreSQL Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.