Backups
How backups work
A job in your own Scaleway account backs up the databases, buckets and configuration of an environment, encrypted, into a bucket in another region.
On this page
Backups by Brewless are made in your own Scaleway account, by an open-source program that runs there: the backup runner (brewless/backup, Apache-2.0). Brewless decides what to back up, sets everything up and watches over it. The data itself goes from your databases and buckets to your backup bucket inside your account, encrypted before it is written, and never through Brewless.
What Brewless sets up in your account
When backups turn on for an environment, Brewless makes, in the environment's Scaleway project:
| What | Where |
|---|---|
The repository bucket, where the backups go (brewless-backups-<project>-<environment>) |
In another region: Paris is backed up to Amsterdam, every other region to Paris. With versioning, and Object Lock unless you switched it off |
The state bucket (brewless-backup-<project>-<region>), with the plan the runner follows and the reports it writes |
The environment's region; one per project and region |
Four Serverless Jobs (brewless-backup-<application>-<environment>-backup, -maintain, -run and -restore) |
The environment's region, or Paris for a region without Serverless Jobs |
| Three IAM applications: the runner, the prune identity and the restore identity | Your Scaleway organisation. See who may delete a backup |
| The runner key and the keys of those identities, in Secret Manager | The environment's project |
| A copy of the runner's image in your own registry, pinned by its digest | The registry namespace of the environment's own project: the one its live release is in, or the one its setting up noted |
Each of these is described as Brewless backups for <application>/<environment>, so you recognise it in the Scaleway console.
A backup run
The …-backup job runs on its schedule, by a cron trigger at Scaleway itself. Every run:
- reads the plan Brewless wrote into the state bucket: what to back up, where to, how long to keep it;
- backs up every database, then every bucket, then the configuration of the environment;
- checks the snapshots it just wrote with
restic check, reading a sample of 1% of the data; - copies the new snapshots to your other destinations, when you have any;
- writes the Recovery Kit at the root of every destination;
- reports to Brewless.
A run counts as successful only when every item of the plan is in the backup and the check passed. A run that backed up none of your databases and buckets, because every one was skipped or failed, is never successful, whatever the runner says: it is failed, or partly successful when the configuration was saved. Buckets that wait for the temporary Instance are the exception: that recovery point is judged once the Instance reported. Runs of one environment never overlap: a run that finds another one alive refuses to start. The history shows such a run as skipped; it backed up nothing, so it is no recovery point.
A run that never reports its end, because its job died or ran out of time, does not stay Running: once an hour Brewless looks at the runner's heartbeat and at the job's run at Scaleway, and closes a run that ended or stopped beating for ten minutes as failed, with abandoned.
When a Brewless release changes the runner or the jobs it runs, every environment whose backups are set up is brought in line within the hour: Brewless sets its backups up again, which changes only what is not in line. The audit trail names it (backup.refresh_started). Backups whose first setting up failed are tried again once a day while they are on (backup.retry_started); switching them on again tries at once.
The runner stores everything with restic, unchanged, so a repository is a standard restic repository that restic itself can read without Brewless. restic splits the data into chunks, stores each chunk once and compresses it, so a backup only adds what changed since the one before.
The daily maintenance
The …-maintain job runs once a day, three hours after a daily backup starts (or at 05:15 for an hourly or custom schedule), as the prune identity. Per destination it forgets the backups past their retention, on Sundays it frees the space they took and checks the repository, and on the first day of the month it reads all of it. It never runs in the same run as a backup.
What Brewless sees
The runner reports to Brewless with a signed message. A report holds names, sizes, times, counts and snapshot ids. It never holds the content of a file, a row of a database, the value of a variable or a key.
The cron triggers are at Scaleway, so backups go on when Brewless cannot be reached. A report that does not arrive is kept in the state bucket and sent again with the next run.
Watching
Every hour Brewless compares the backups it expected, from the schedule, with what the runner reported and what the state bucket says. A backup that has not succeeded within its schedule plus three hours is overdue: the Backups tab says so and the owners and admins of the organisation get a mail. A failed or partly failed run is mailed too, and so is a recovery key that was made but never confirmed. Brewless never sends a request to your application for this.
What the protection levels mean
The Backups tab shows which level an environment reached. The backups protect against losing data by mistake, a broken release or database, losing a region, and a stolen key of your application. With Object Lock in Compliance mode, or a destination at another provider, they also hold when your Scaleway account itself is compromised.
They do not make your application highly available: a restore is work you start, and it takes time. How far back you can go is the time between two backups, 24 hours with the default daily schedule and an hour with hourly. There is no point-in-time recovery. See known limitations.
What it costs
Backups are part of every plan, Solo, Business and Enterprise, and work without a subscription too; no plan holds a part of them back. Scaleway bills you directly for the storage of the repository, the transfer to another region, the minutes the jobs run and the hours of the temporary Instance for buckets too large for a job. The Backups tab and brewless plan show an estimate at Scaleway's list prices before anything costly is switched on, and say it is an estimate: what deduplication and compression save depends on your data, and Brewless never reads it.