The Decisions You Cannot Cheaply Reverse

Backups Are A Restore You Have Not Run

Recovery point and recovery time are numbers you choose and pay for. On common defaults your worst case is a day of lost data, and the only honest measurement is a restore you performed.

There are two numbers in this subject and most founders cannot state either for their own product. The recovery point objective is how much data you are willing to lose, measured in time. The recovery time objective is how long you are willing to be down. Neither is a feature your provider gives you: they are numbers you choose and pay for, and never choosing means accepting the default.

What the default actually is

Take Supabase as the worked example, because the numbers are published and typical of the category. On the free plan there are no automatic backups at all, and a project pauses after a week of inactivity. Pro, at 25 dollars a month, gets the last seven days of daily backups. Team gets fourteen days. Point-in-time recovery is a paid add-on at 100 dollars a month per seven days of retention, on top of at least the Small compute size it requires, so call it a little over 100 dollars a month in practice. It buys a worst-case recovery point of about two minutes, and enabling it replaces the daily backups rather than adding to them.

Read that as a recovery point rather than a feature list: on default Pro your worst case is losing up to twenty-four hours, because the failure can land in the hour before tonight's snapshot. Asked what they would lose, most founders say nothing. The honest answer is a number they chose by not choosing, and the distance between a day and two minutes is a little over a hundred dollars a month.

24 hours

worst-case data loss on a daily-backup plan, measured from your last snapshot

Five mechanisms, none of them working

On 31 January 2017 a GitLab engineer, cleaning up after a spam and load incident at the end of a long day, removed the data directory on the wrong node. It was production. What makes this canonical is not the mistake but their own published postmortem: of five backup and replication mechanisms they believed they had, not one was working as expected. They recovered from a staging snapshot roughly six hours old. Competent engineers at a company whose product is source control, not careless about backups: they had five. They had simply never performed a restore.

An untested restore is not a backup, it is a belief. The only measurement that counts is the wall-clock time of a restore you actually performed, on a day you chose, from the backup you actually have. Everything else is a green tick in a dashboard written by somebody with no stake in your recovery.

Things that are not backups

  • A read replica. It applies your DELETE in milliseconds. Replication protects you from a server dying, never from your own code or your own hands.
  • The provider's durability promise. Eleven nines describes their disks, not your mistakes, and no durability figure has ever restored a dropped table.
  • A snapshot that lives in the same account, reachable with the same credential your application runs under. One compromised key that can delete both the data and the backups is a single failure, not two. Keep at least one copy somewhere your production credentials cannot reach.
  • The database on its own. A restore that brings back Postgres but not the uploaded files, the secrets or the DNS records has restored an application your customers still cannot use, and the files are what they notice first.

The drill

  1. Detectan alert or a report, and a named person allowed to declare an incident
  2. Decidewhich point to restore to, and what losing the gap actually costs
  3. Restore asideinto a new environment, never over the live one
  4. Verifyrow counts, newest row, one known record, one file download, one login
  5. Cut overswitch traffic, then write down the wall clock

Never restore over the live database: a failed restore over production turns a recoverable incident into an unrecoverable one, and the data written since may still be worth keeping. And verify against invariants written down in advance: the number of accounts, the timestamp of the newest order, one record whose contents you know, one file that downloads. Without that list, verification becomes somebody clicking around saying it looks fine.

Run the drill once a quarter on a calm Wednesday and record three numbers: how long until someone noticed, how long the restore took end to end, and how much data the recovery point cost you. Those are your real numbers. The ones on the pricing page are the vendor's.

Most data loss is self-inflicted

Hosts rarely lose your data. You do. A script run against the wrong environment, a migration that dropped the wrong column, an admin tool with a delete button and no confirmation, a background job with a bug in its WHERE clause. So the controls that matter sit upstream of the backup: no default interactive access to production, destructive scripts that print a count and require a typed confirmation, dry run as the default mode, separate credentials for reading and writing. Then one export a day into storage in a different account, so the worst case is bounded by something an attacker holding your production key cannot reach.

Decide your two numbers this week, in writing, with the price attached. Price an hour of lost orders against about a hundred dollars a month, and you have just made the point-in-time recovery decision. Then put the drill in the calendar, and treat one you skipped exactly as you would treat one that failed.

Key takeaways

1Recovery point and recovery time are numbers you choose and pay for. Not choosing accepts the default, which on daily backups is up to a day of lost data.
2Supabase specifics: no automatic backups on free, seven days of daily on Pro, and point-in-time recovery at 100 dollars a month per seven days of retention plus the compute size it requires, for a roughly two-minute recovery point.
3GitLab in January 2017 had five backup and replication mechanisms and, by their own postmortem, none working as believed. Having backups and having restored are different states.
4A replica, a durability promise, and a snapshot your app credentials can delete are not backups. Nor is the database without the files, secrets and DNS.
5Drill quarterly: restore aside, verify against pre-written invariants, record the wall clock. That time is your real recovery time objective.

This is one lesson of 541.

The whole Foundation is free — 16 subjects, beginner to advanced. Sign in to track what you have read, take the end-of-module quizzes, and use the terminal.