Explanation

Backup and Recovery Strategy

Understanding CNPG’s backup approach and recovery mechanisms.

Backup Strategy

CloudNativePG uses Barman (Backup and Recovery Manager) for PostgreSQL backups:

Full Backups

  • Complete snapshot of the database

  • Stored in S3-compatible storage (Hetzner Object Storage)

  • Compressed and optionally encrypted

  • Scheduled via ScheduledBackup CRD

WAL Archiving

  • Continuous backup via Write-Ahead Log (WAL) files

  • Enables point-in-time recovery (PITR)

  • Archived to S3 in real-time

  • Compressed to save storage space

Recovery Mechanisms

Full Restore

Restore entire cluster from a full backup.

Point-in-Time Recovery (PITR)

Restore to any point in time between backups using WAL replay.

Disaster Recovery

Create new cluster from backups in different namespace or cluster.

Storage Backend

Hetzner Object Storage (S3-compatible):

  • Region: fsn1 (Falkenstein) - same as cluster

  • Bucket naming: <app>-postgres-backup-kup6s

  • Credentials: Shared Hetzner S3 credentials via ExternalSecret

  • Retention: Configurable per-cluster (default 30 days)