Defining a disaster recovery plan involves defining backup policies. A key aspect of backup policies is to define how long backup data is retained for disaster recovery purposes. This applies to all digital content, including PostgreSQL databases.
Barman 1.2.0 introduces automated management of backup retention policies of PostgreSQL servers.
Retention policies were one of the midterm goals that we had given ourselves when the whole Barman idea began to take shape. I am glad that, thanks to the vision of a French company (which explicitly requested to remain anonymous), we were able to undertake their open-source development.
What are retention policies?
A retention policy is a user-defined set of guidelines and principles that determines how long backups and their related archive logs need to be retained for recovery procedures. In a PostgreSQL database scenario:
Base backups and archive logs form the so-called “backup catalogue” and allow database administrators to perform Point-In-Time recovery operations.
Further information on PostgreSQL physical backup and continuous archiving can be found in the Postgres documentation.
Why are retention policies so important?
In some countries and environments, it is the law that requires ICT departments to enforce them for data security and protection reasons. In Italy, for instance, the “Codice dell’Amministrazione Digitale” (CAD) requires that public organisations report retention periods in official documents such as their Disaster Recovery Plan.
From a more practical point of view, retention policies improve automation of a backup solution, while reducing the management and configuration complexity.
How are they implemented in Barman?
Barman at any time retains:
On the same topic, you may wish to read one of my previous blog posts about the backup catalogue and the WAL archive in Barman.
Barman users can define a retention policy in terms of: