Start free

Your data, your backups: backups in Brewless

How Brewless backs up Laravel databases, buckets and configuration into another region of your own Scaleway account, encrypted, and restorable without us.

In this post
  1. Does a serverless Laravel app still need backups?
  2. Where do the backups run?
  3. How does it back up a database without waking it?
  4. And the buckets?
  5. Who holds the keys?
  6. What about a second place?
  7. How do I restore without Brewless?
  8. What does it cost?
  9. What does it not do?
  10. Who does what?

Your code is in Git. Your database, the files your users uploaded and the variables your application runs with are not. Until now Brewless left those to the provider: Serverless SQL keeps a daily backup for seven days, in the same region, in the same account. That helps when someone drops a table. It does not help when the region, the account or the provider is the thing that went wrong.

So Brewless makes backups itself, in your own Scaleway account. Backups are in beta: you can switch them on for your environments now. We run them on our own applications first, and publish measured figures after that pilot. This post is about how they work, and about the limits we would rather tell you than have you find.

Does a serverless Laravel app still need backups?

Yes. Serverless takes the servers away, not the data. Your containers can be rebuilt from Git in minutes; a database that was deleted, corrupted or locked away cannot. What has to be protected is everything Git does not hold:

What Where it lives In Git?
Code and brewless.yml Your repository Yes
Rows Serverless SQL or a Managed Database No
Uploads and generated files Object Storage buckets No
Variables and secrets Your Secret Manager No
DNS records and edge settings Scaleway and bunny.net No

Where do the backups run?

In your account. A small open source program, brewless-backup (Apache-2.0), runs as Scaleway Serverless Jobs in the environment's own project. It calls the official restic, rclone, pg_dump and mariadb-dump binaries rather than an engine of our own, so a repository is exactly what restic itself reads and writes.

Backups are opt-in: you switch them on per environment, in the console or in brewless.yml. The schedule is then a cron trigger at Scaleway, 03:30 every day by default. Brewless writes the plan the job follows and reads the report it sends back. Your data goes from your database and buckets to a bucket in another region of your account, and never through Brewless.

brewless.yml
environments:
  production:
    backup:
      enabled: true
      schedule: daily
      at: "03:30"
      retention:
        daily: 30

Switched on without more settings, an environment gets exactly this.

How does it back up a database without waking it?

By not connecting to it. For a daily backup the runner asks Scaleway for an export of the newest backup Scaleway already made, streams the download through pg_restore into plain SQL and hands it to restic. A Serverless SQL Database is not woken for it.

More often than daily, the runner dumps the database directly with pg_dump, and that wakes it each time. brewless plan and the Backups tab show what that adds before you change the schedule.

The dump is stored as plain SQL, not as a compressed custom-format dump. restic compresses with zstd itself and splits what it stores into content-defined chunks, so a table that barely changed adds little. A dump that is already compressed changes from top to bottom when one row changes, and defeats that.

And the buckets?

The runner mounts each bucket read-only with rclone and lets restic walk it. An object whose size and modification time did not change is only listed, not downloaded again. The content type, cache headers and other metadata of each object go into a manifest in the same snapshot, so a restore puts them back.

Left out by themselves: a cache, the storage zones at the edge, and the buckets that hold backups already. A bucket two environments share is backed up once, by production first.

Who holds the keys?

This is where backup products like to say "zero-knowledge". We do not, because it would not be true.

  • The runner key encrypts the backups. The job makes it on its first run and keeps it in your Secret Manager, where only that environment's job may read it. Brewless creates that job, so Brewless could technically read the key. It does not, and nothing in Brewless asks for it, but you should know it could.
  • The recovery key is a second key to the same backups. The job makes it in your account and encrypts it for your browser alone; you see it once and type four of its characters back. Brewless never holds it, only an encrypted copy for at most a day until you confirm.
  • Three identities. The one that makes backups may add to the bucket but not delete from it. A separate maintenance identity removes backups past their retention, and its key is out of the runner's reach. A third only reads, for restores.

The backup bucket has Object Lock: in Governance mode, the default, nobody can change or delete a backup before its lock ends unless an account admin explicitly bypasses it; in Compliance mode, not even the account owner can.

Warning

Lose both the runner key and the recovery key and the backups cannot be read, by you or by anyone. Keep the recovery key in a password manager or a safe, away from your Scaleway account.

What about a second place?

The primary destination is in your own Scaleway project, Paris backed up to Amsterdam and the other regions to Paris. You can add your own: another Scaleway bucket, any S3 service, or bunny.net Storage. After each successful, checked backup the job copies the new snapshots there with restic copy.

Bunny Storage has no versioning or Object Lock, so a Bunny destination is a second copy at another provider, never an immutable one.

How do I restore without Brewless?

At the root of every destination the runner keeps a Recovery Kit: RECOVERY.md, the steps in plain language, and recovery.json, where every repository is and what each recovery point holds. Neither holds a key. With an access key for the bucket and your recovery key:

brewless-backup recover --kit recovery.json snapshots
brewless-backup recover --kit recovery.json database app-db --output app-db.sql

RECOVERY.md gives the same steps with plain restic and rclone. With Brewless around, the console and brewless backup:restore restore into a new database or bucket next to the current one, and you switch over when you have looked. See Restoring from backups.

What does it cost?

Nothing at Brewless: backups are part of every plan, Solo, Business and Enterprise, with nothing held back for a higher one, and you switch them on where you want them. You pay only Scaleway, which bills you for the storage in the other region and the minutes the jobs run. The console shows the estimate for each environment at Scaleway's list prices before you switch backups on; we publish measured figures only once the pilot has measured them.

The console shows the estimate for each environment at Scaleway's list prices, labelled as an estimate, because what deduplication saves depends on data Brewless never reads.

What does it not do?

  • No point-in-time recovery. You go back to a backup run, at most a day old by default.
  • Not one moment. Databases are taken first and buckets after, so a recovery point is not one consistent instant across both.
  • No cache. A Redis cache is not backed up; it is not data to keep.
  • Restore times depend on the size of what you restore. We publish no restore times before we have measured them in our own drill.

Who does what?

Brewless You
Plan, schedule and watch the backups Yes
Run the backups Your account runs the jobs
Hold the data and pay for storage Yes, at Scaleway
Keep the recovery key Never Yes
Delete a backup bucket when you leave Never Your choice, at Scaleway

Read how backups work in the documentation, or the backups page for the short version.

Frequently asked questions

Does Brewless store my backups?

No. The backups are written to a bucket in your own Scaleway account, by a job that runs in that account. Brewless receives a signed report with names, sizes and times, never rows, files or variable values.

Does a daily backup wake my Serverless SQL Database?

No. A daily backup exports the newest backup Scaleway already made of the database, which does not wake it. An hourly schedule dumps the database directly and does wake it each time; brewless plan says what that adds before you switch it on.

Can I restore my backups without Brewless?

Yes. Every destination holds a Recovery Kit, RECOVERY.md and recovery.json, that says where everything is. With your recovery key you restore with the open source brewless-backup tool, or with plain restic and rclone.

Do backups by Brewless cost extra?

Not at Brewless; they are part of every plan, Solo, Business and Enterprise. Scaleway bills you directly for the storage in the other region and the minutes the jobs run, and the console shows the estimate for each environment.

Is there point-in-time recovery?

No. You restore to a backup run, at most a day old by default or an hour with an hourly schedule. Serverless SQL itself offers no point-in-time recovery either.

All posts Read this post as markdown

Try it on your own app

Brewless deploys your Laravel app to Scaleway and bunny.net, in your own accounts. Start free with one application, production included.