Docs / Hosted backups and drills

Hosted backups and drills

A database with no server of yours beside it, such as Supabase, Neon or RDS, can be backed up by SafeGrd. A surface with no host to drill it, such as one backed up from a GitHub Actions workflow, can be drilled by SafeGrd. Either way, SafeGrd starts a machine for that one job, gives it the one secret the job needs, and destroys it when the job ends.

Backup

  1. Your database read with a read-only role
  2. A machine for this backup dumps, compresses, encrypts
  3. Hosted storage locked under Object Lock
Given
the connection string, for this backup only
Never given
the key that decrypts backups

Fire Drill

  1. Hosted storage the newest snapshot
  2. A machine for this drill restores into a throwaway database
  3. A signed record every table counted
Given
the key, for the one snapshot it restores
Never given
the connection string
Both machines are destroyed when their job ends. The backup goes from the database to storage and from storage to the drill, and never through SafeGrd's server.
A PostgreSQL database added with Back up on SafeGrd. The first backup runs as soon as it is added, and the drill that follows restores 4 tables and 454,040 rows.

Back up a database with nothing to install

  1. Under Surfaces, choose Add surface, then Back up on SafeGrd.
  2. Name it, and pick what it is: PostgreSQL, MySQL or MariaDB, MongoDB, or a bucket.
  3. Paste the connection string. Test connection opens it from SafeGrd's server and says what failed when it cannot.
  4. Pick how often to back up and how long to keep each backup, then Add and back up now.

The first backup starts within a few minutes, so a wrong password shows up then and not on the first scheduled night. Its drill follows on your plan's schedule.

The database has to accept connections from the internet, and a read-only role is enough. Where SafeGrd's machines connect from fixed addresses, the console lists them beside Back up on SafeGrd, for a database whose firewall lists the addresses it accepts.

Supabase

Pick a Supabase project signs you in to Supabase and lists your projects, with the session pooler's address filled in. You type the project's database password, which Supabase does not give out. Without the sign-in, copy the Session pooler string (port 5432) from Connect in Supabase's dashboard and add ?sslmode=require. The transaction pooler on port 6543 cannot take a backup. A project's Storage is a bucket: add it the same way with its endpoint and S3 key, and it is backed up as one archive of its objects (details).

Each backup uploads what changed

A PostgreSQL backup reads every table and uploads only the rows that changed since the last one. The machine works that out from a cache of what storage already holds. SafeGrd keeps the cache encrypted between backups, under a key it gives only to that surface's backup machines.

What it costs at your provider

Every backup reads the whole database, and the provider may bill that as egress. Price this schedule in the form measures the database and prices the schedule at its provider before you add it. safegrd estimate does the same from a terminal.

Drill a surface on SafeGrd

Set Drill on SafeGrd in a surface's panel. From then on, each time a drill is due, SafeGrd starts a machine for it, restores the newest snapshot, checks it as a host would, signs the record and destroys the machine. The Fire Drills tab shows that it ran on SafeGrd. A surface SafeGrd backs up is drilled this way from the start.

Which machine gets which secret

Each job gets a token minted for it alone. The token reaches the routes that job's kind needs, for the one surface, and stops working at the job's deadline.

JobGivenNever given
BackupThe connection string or bucket key, the public key it encrypts to, and the key to the surface's repository cache.The key that decrypts backups.
Fire DrillThe key for the snapshot it restores.The connection string.

Every release is written to the Key access record before it happens, with the job it went to and the time. Open it under Projects, Storage. Security and key custody covers how SafeGrd seals what it holds.

Minutes on SafeGrd

Each plan includes an amount of machine time over a rolling 30 days, and a largest snapshot for a sandbox drill:

PlanRuns on SafeGrdLargest snapshotAt once
Free20 minutes a monthIn memory, within the plan’s storage1
Starter800 minutes a month5 GB1
Growth2,500 minutes a month8 GB2
Scale8,000 minutes a month25 GB4

A job counts the time its machine ran, from when SafeGrd asked for the machine to when the job ended, or 10 minutes for each GB it moved when that is more. A drill of a 2 GB snapshot whose machine runs for 6 minutes counts 20 minutes. A backup of a 300 MB database that runs for 3 minutes counts 3. Fractions of a minute count, and there is no minimum.