Skip to content

No backup strategy: data loss on failure

Quick summary

Your service has no backup strategy — if the storage fails, all data is permanently lost.

Why this happens

  • No backup job or schedule is configured for the database or persistent volumes

  • Backups are stored on the same infrastructure as the production data

  • Backup restoration was never tested, so backups may be corrupt or incomplete

Minimal example

✗ Broken code
# No backup configured for the database
apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
        - name: postgres
          image: postgres:15
          # no backup — data loss if storage fails
✓ Fixed code
# Add a backup CronJob
apiVersion: batch/v1
kind: CronJob
spec:
  schedule: '0 2 * * *' # daily at 2am
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: backup
              image: pg-backup:latest
              env:
                - name: PGPASSWORD
                  valueFrom:
                    secretKeyRef: { name: db-secret, key: password }
              command: ['pg_dump', '-Fc', '-f', '/backups/db.dump']

Adding a daily CronJob that runs pg_dump creates automated database backups, preventing data loss on storage failure.

How to diagnose

  • Check for backup jobs or cron jobs that back up the database or volumes

  • Verify that backups are stored in a different location or cloud provider than production

  • Test a backup restore to verify the backup is valid and the restore process works

How to fix

  • Set up automated, scheduled backups for all stateful services

  • Store backups in a different region, availability zone, or cloud provider

  • Regularly test backup restoration to verify backups are valid and complete

How to prevent

  • Always configure automated backups for databases and test restoration regularly

  • Store backups off-site and use backup retention policies for long-term recovery

Related Resources

Related Glossary

Related Lessons

← Back to language