← All posts

Is your SaaS really backed up? RPO, RTO and disaster recovery explained (the complete guide)

"We have backups" doesn't tell you how much data you'd lose or how long your application would be down. RPO and RTO, what to back up, restore testing, and the questions to ask your development team.

Is your SaaS really backed up? RPO, RTO and disaster recovery explained (the complete guide)

Key points

  • Two numbers sum up your protection: how much data you can afford to lose (RPO) and how long you can be down (RTO).
  • A backup that has never been restored is an assumption; only regular testing tells you it works and how long it takes.
  • Backups must live away from production, encrypted and protected against deletion, including by a compromised account.

Nobody asks about backups when a project kicks off. Almost everybody asks right after an incident: “we did have backups, didn’t we?” Usually the answer is yes. What’s missing are the details that matter on the day you need them: how old the last usable copy is, how long a restore takes, who knows how to run one, and whether the files your customers uploaded are covered too. For a SaaS product this isn’t a purely technical concern. Your customers trust you with their data, and your contract often promises them a level of availability. This guide explains, in plain terms, how to decide what level of protection you need, what has to be backed up, how we set it up on our projects, and which questions to put to your technical team to find out where you really stand.

What “we have backups” doesn’t guarantee

It’s a reassuring sentence that can describe very different realities. These are the situations we run into most often when auditing existing applications:

  • Snapshots with the same host, on the same account. Convenient day to day, but if the account is compromised, suspended over an unpaid invoice or hit by a bad click, production and its backups vanish together.
  • Replication sold as backup. A database replicated in real time survives a server failure, not a mistake: a DELETE without a WHERE clause is faithfully replicated within milliseconds.
  • The database, but not the files. Invoice PDFs, attachments, photos and documents imported by customers usually sit in object storage or a server folder that the backup routine never touches.
  • Backups failing silently. A full disk, a rotated password, a PostgreSQL upgrade without the matching dump tool: the script still runs, produces nothing usable, and nobody hears about it.
  • No tested restore. Nobody knows how long it takes, which manual steps it needs, or where the decryption key is kept.

None of this is rare, and none of it means the team was careless. These are natural blind spots, because backups are almost never used. The rest of this guide is about making them visible.

RPO and RTO: two numbers to agree on before any technical discussion

RPO (Recovery Point Objective) is the maximum amount of data you’re willing to lose, measured in time. With one backup a night, your worst-case RPO is roughly 24 hours: if the database is lost at 6 pm, everything entered since the previous evening is gone.

RTO (Recovery Time Objective) is the maximum time the application can stay unavailable before it’s back in service. It covers the whole chain: noticing the problem, deciding what to do, fetching the backup, restoring it, checking it, reopening.

Both are business decisions, not technical ones. To set them, we ask our clients concrete questions. If your users lost their last day of work, what would happen? Could they redo it from emails or paper? If the application went down for half a weekday, how many customers would call? What have you promised in your terms of service or customer contracts?

The lower these numbers, the more the solution costs, both in infrastructure and in setup time. An internal tool used by a few teams doesn’t need what a booking or invoicing product needs, where every minute of downtime and every lost record shows up immediately on your customers’ side. What matters is that the numbers are chosen deliberately, written down and checked, instead of discovered during the incident.

In practice, an RPO of about a day is met by regular full backups. Getting down to minutes means continuously archiving the database’s transaction log (WAL on PostgreSQL, binlog on MySQL), which enables point-in-time recovery. Managed databases from the major hosts offer this, but you still have to confirm it’s switched on and check how far back it goes.

What to back up (much more than the database)

A SaaS application has several layers, and restoring the database alone won’t get it running again. This is the checklist we go through:

  • The database: obviously, with full copies and, depending on your RPO, continuous transaction archiving.
  • User files: object storage (S3 or similar) with versioning enabled, or a server folder copied elsewhere. A restored database pointing at missing files gives you an app that looks fine but is full of broken links.
  • Configuration and secrets: environment variables, third-party API keys (payments, email, storage), certificates. Without them the restored code won’t boot, or can no longer talk to Stripe or your email provider.
  • Code and infrastructure: code is normally in Git, but infrastructure (servers, settings, scheduled jobs) is often configured by hand. Describing it in versioned files is what lets you rebuild an environment in hours instead of days.
  • Access: who holds the logins for the domain registrar, DNS and hosting account? An incident is the worst time to find out only a former contractor had them.

Data that can be recomputed (caches, search indexes, temporary job queues) doesn’t need backing up, as long as the recovery procedure includes rebuilding it.

How we set up backups in practice

On our PostgreSQL projects, the database gets two layers: the host’s managed backups with point-in-time recovery for a short RPO, and an independent daily dump shipped to a different provider. The second covers what the first can’t: losing the hosting account itself. Here’s a simplified version of the daily script:

#!/usr/bin/env bash
# backup-db.sh: daily dump, encrypted, shipped outside the main provider
set -euo pipefail

STAMP=$(date -u +%Y-%m-%dT%H%MZ)
FILE="/var/backups/app/db-$STAMP.dump"

# Custom format: compressed, and allows selective restores (one table, one schema)
pg_dump --format=custom --no-owner --dbname="$DATABASE_URL" --file="$FILE"

# Encrypt before it leaves the server (only the public key lives on the server)
age -r "$BACKUP_PUBLIC_KEY" -o "$FILE.age" "$FILE"
rm "$FILE"

# Copy to object storage at another provider, in a bucket with object lock
aws s3 cp "$FILE.age" "s3://$BACKUP_BUCKET/db/$STAMP.dump.age" --endpoint-url "$BACKUP_ENDPOINT"

# Heartbeat: if this ping doesn't arrive during the day, an alert fires
curl -fsS -m 10 "$HEARTBEAT_URL" > /dev/null

A few choices are worth explaining. pg_dump‘s custom format lets you restore a single table, which you’ll need far more often than a full restore. Encryption happens on the server with a public key, so even if someone reached the backup storage the files would be unreadable, and the private key never sits on production. The destination bucket has object lock enabled: for the retention period nobody can delete or overwrite the files, not even with stolen admin credentials. That’s the most effective defence against ransomware, which specifically hunts for backups before encrypting production.

Finally, the heartbeat ping at the end flips the usual logic. You’re not alerted when an error is detected; you’re alerted when the success signal fails to arrive. That’s what catches backups that fail silently, including when the server itself is down.

Retention usually follows tiers: daily copies for a few weeks, weekly for a few months, monthly beyond that. The exact periods depend on your obligations and your data deletion policy. Keeping backups forever contradicts a promise to delete a departing customer’s data, so align this with your privacy policy.

Testing restores: the only metric that counts

A backup is only worth something if it restores, and the RTO you picked is wishful thinking until someone has timed a real restore. So we automate a monthly test: fetch the latest backup, decrypt it, restore it into a throwaway database and check what’s inside.

#!/usr/bin/env bash
# restore-test.sh: every month, restore the latest backup into a throwaway database
set -euo pipefail
START=$(date +%s)

LATEST=$(aws s3 ls "s3://$BACKUP_BUCKET/db/" --endpoint-url "$BACKUP_ENDPOINT" | sort | tail -n 1 | awk '{print $4}')
aws s3 cp "s3://$BACKUP_BUCKET/db/$LATEST" /tmp/restore.dump.age --endpoint-url "$BACKUP_ENDPOINT"
age -d -i "$BACKUP_KEY_FILE" -o /tmp/restore.dump /tmp/restore.dump.age

dropdb --if-exists restore_test && createdb restore_test
pg_restore --no-owner --jobs=4 --dbname=restore_test /tmp/restore.dump

# Checks: the database must contain recent data, not just empty tables
psql -d restore_test -Atc "SELECT count(*) FROM tenants"
psql -d restore_test -Atc "SELECT max(created_at) FROM invoices"

echo "Restore completed in $(( $(date +%s) - START )) s"
rm -f /tmp/restore.dump /tmp/restore.dump.age

The two check queries matter. A restore can “succeed” by creating the tables without the data, for instance if the dump was truncated. Confirming there are customers and that the newest invoice is from yesterday gives you real confidence. The duration printed at the end is your measured RTO for the restore step; add the time it takes to detect, decide and verify.

Twice a year we go further with a full drill: rebuild the entire application on a fresh environment from the backups and the documentation, ideally by someone who has never done it. That’s when you find the forgotten manual step, the secret that wasn’t written down anywhere, or the script that relied on one specific tool version. Each finding goes into the written procedure, the runbook, which has to be usable under pressure at two in the morning.

The incidents to plan for, and what each one needs

A recovery plan isn’t one procedure. Real incidents vary, and each calls for a different response:

  • A customer deletes their own data by mistake. By far the most common case, and the trickiest in a multi-tenant application: you can’t roll the whole database back to yesterday without wiping every other customer’s work. You restore the backup alongside, then re-inject only that customer’s rows.
  • A bug or migration corrupts data. Sometimes it’s only noticed days later, which is why older backups are worth keeping, along with the ability to compare a past state with the current one.
  • The server or database goes down. Replication and managed databases do the heavy lifting here; backups are the last resort.
  • The hosting account is compromised or unreachable. This is the scenario that justifies the copy at another provider, with separate credentials and locked files.

For the first case, a targeted restore looks like this, table by table, in dependency order (the customer, then their projects, then their tasks):

# 1. On the database restored next to production: extract customer 42's rows
psql -d restore_test -c "copy (SELECT * FROM projects WHERE tenant_id = 42) TO 'projects-42.csv' WITH CSV HEADER"

# 2. On production: load into a temp table, then re-insert only what's missing
psql -d app <<'SQL'
BEGIN;
CREATE TEMP TABLE projects_restore (LIKE projects INCLUDING DEFAULTS);
copy projects_restore FROM 'projects-42.csv' WITH CSV HEADER
INSERT INTO projects SELECT * FROM projects_restore ON CONFLICT (id) DO NOTHING;
COMMIT;
SQL

ON CONFLICT DO NOTHING guarantees nothing that already exists gets overwritten; you only put back what’s missing. In an application designed from day one with a tenant ID on every table, this is an hour’s work. In a database where customers’ data is mixed with no clear identifier, it can take days. That’s one more reason to get the multi-tenant model right early, and to use soft deletes (a deletion date rather than immediate erasure) on sensitive data, with a trash the customer can empty themselves.

Questions to ask your agency or your team

If you run a SaaS business without a technical background, you don’t need to read the scripts. You need clear answers to these questions, ideally in writing:

  • What are our current RPO and RTO, and how were they measured?
  • Where are the backups stored, with which provider, and can they be reached with the same credentials as production?
  • Are user files, configuration and secrets backed up?
  • Are backups encrypted? Who holds the key, and where is it kept?
  • When was the last tested restore, and how long did it take?
  • Are we alerted automatically when a backup doesn’t happen?
  • Can we restore a single customer’s data without touching anyone else’s?
  • How long do we keep backups, and does that match our data deletion commitments?

A vague answer to any of these isn’t a disaster, but it is work to schedule. In most of the audits we run, a few days of effort is enough to go from assumed protection to verified protection, tested monthly and documented.

FAQ

My host does automatic backups. Isn’t that enough?

It’s a good foundation, but check three things: how often they run and how long they’re kept, whether they cover files as well, and whether they’d survive losing your account with that host. In most cases an independent copy at another provider is still needed.

How often should we test a restore?

We automate a monthly database test and run a full rebuild drill once or twice a year. A test is also essential after any significant change: a new database version, a new host, a new kind of stored file.

Do backups cause GDPR problems?

They contain personal data, so they must be protected (encryption, restricted access) and kept for a justified period. When a customer asks for deletion, common practice is to remove the data from production and let older backups expire on their normal retention schedule, and to document that approach.

What does a proper recovery plan cost?

It depends mostly on the RPO and RTO you’re aiming for and on where the infrastructure starts from. An audit lets you price the gaps precisely; often most of the work is organisational (documenting, automating tests, separating access) rather than expensive infrastructure.

Not sure what your application’s backups actually cover? We audit and harden existing SaaS applications: backups, a tested recovery plan, and documentation your team can follow on the day it matters.

Share LinkedIn Facebook X WhatsApp
</>

webtestudio

Web agency: custom WordPress sites, premium themes and SaaS software.

Discuss your project →