super

super

How to test that your Supabase backup actually restores

I wrote a guide on restore-testing a Supabase Postgres backup, because a truncated dump, a dump taken with the wrong role and a job that half-failed all look the same as a good backup sitting in a bucket.

The manual version takes about fifteen minutes and never connects to production:

  • Start a throwaway Postgres in Docker that matches your Supabase major version, bound to 127.0.0.1 and with a fresh random password, and check readiness over TCP rather than the Unix socket.
  • Create stand-ins for what a Supabase project provides (the anon, authenticated and service_role roles and the auth.uid() / auth.jwt() helpers). Without them, a table with default auth.uid() never gets created, and pg_restore carries on to the end anyway.
  • Restore with --no-owner --no-privileges, then sort the expected sandbox errors from the real ones.
  • Check the table count, that tables that should have rows aren’t empty, and max(created_at) to catch a job that has quietly stopped running.

It also covers running the same loop as one command with the open-source backupdrill CLI (MIT, I work on it), what a passed test does and doesn’t prove, and how often to run it.

First Post!

aicost_tools

aicost_tools

The “looks fine in the bucket” trap is real — we’ve been burned by truncated dumps that still had a plausible byte size. Matching the major Postgres version in the throwaway container is the detail most guides skip. We work on aicost.tools (editor account), so we treat restore drills as part of cost hygiene too: a backup you can’t restore is just expensive object storage. Do you also assert row counts / checksum on a couple of critical tables after restore?

Where Next?

Popular Backend topics Top

lpil
Shayne gave this excellent talk the other day on Gleam, so I thought I’d share it. From my point of view it was really interesting to se...
New
DevotionGeo
There are 3 main formatters for Erlang which you can use from the command-line, rebar3_format, Steamroller elmfmt. Visual Studio Cod...
New
ErlangSolutions
Interested in a blazingly fast type checker with 25 years of investment, delivered on the BEAM? Check out Caramel, an exciting project fr...
New
First poster: bot
When I need to configure something in a complicated way, I find myself reviewing the embedded language that provided the server to create...
New
First poster: bot
In a previous post we talked about implementing a simple video chat with WebRTC and Elixir. This update will touch on some of the API cha...
New
AstonJ
Just finished doing a clean install of macOS (which I highly recommend btw!) and have updated my macOS Ruby & Elixir/Erlang dev env s...
New
First poster: bot
It’s easy to view yourself as “not a real programmer.” There are programs out there that everyone uses, and it’s easy to put their develo...
/c
New
First poster: AstonJ
They expect you to make a onepage application (SPA) The polaris design system officially only supports react Integration with the s...
New
CommunityNews
I don’t like reading thick O’Reilly books when I start learning new programming languages. Rather, I like starting by writing small and d...
New
MarcinKasprowicz
Elixir language viewed from the perspective of a JavaScript developer. I compared selected aspects of the two languages and touched on to...
New

Other popular topics Top

PragmaticBookshelf
Instantly view the changes you make to an app with stateful hot reload, and define a declarative UI in the same language as the app logic...
New
AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
PragmaticBookshelf
Stop developing web apps with yesterday’s tools. Today, developers are increasingly adopting Clojure as a web-development platform. See f...
New
PragmaticBookshelf
Write Elixir tests that you can be proud of. Dive into Elixir’s test philosophy and gain mastery over the terminology and concepts that u...
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Get the comprehensive, insider information you need for Rails 8 with the new edition of this award-winning classic. Sam Ruby @rubys ...
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New