Back to blog
DevOps Deployment Rollback Backups PostgreSQL SaaS

When to Roll Back a Release, and When the Database Goes Back Too

By Ken B Portfolio · Published on November 10, 2026
Illustration of a developer working at a laptop

Every app ships a bad release sooner or later. What matters is how long your customers feel it, and whether any of their data is lost.

A good rollback plan answers that before it happens: which problem gets which fix, how fast, and when the database goes back too.

A plan only counts once it’s checked

While getting a job-alert app I built ready for its first users, I checked its rollback plan against the live setup, line by line. Three things turned up:

  • The nightly backup had failed three nights in a row, and nobody had noticed.
  • The snapshot before each database change was built, but not switched on yet.
  • AI features on the live site could not run: the key was saved under a misspelled name. Rolling back would not have helped, because the older version reads the same setting. The fix was forward: correct the name, rebuild, done in minutes.

All three turned up before any customer was on the app. The key was fixed the same day; the other two sit on the launch checklist.

The restore itself was practised on the test copy: take a snapshot, add a test record, restore, check the record is gone and the site still runs. Trying it once, before it matters, is the point.

Here is the plan it was checked against.

Three moves, cheapest first

MoveWhat it doesHow fastWhat it costs
Fix forwardShip a small fixMinutesNothing, if the fix is small and sure
Roll back the codeThe live site goes back to the version beforeSeconds on modern hostingNothing: customer data stays as it is
Restore the databaseThe data goes back to an earlier minuteMinutesEverything every customer did after that minute

Pick the cheapest move that stops the harm. The database goes back last.

Which problem gets which move

  • Customers are blocked (site down, can’t sign in, the main feature fails for everyone): roll back the code first, find the cause after.
  • A customer sees someone else’s data: roll back now. Then write down who saw what, and when.
  • One feature is broken, the rest works: fix forward, if the fix can be live within about an hour. If not, roll back.
  • It looks wrong but nothing is blocked: fix it in the next release.
  • An outside service is down (hosting, sign-in, the AI provider): nothing to roll back. Turn off the feature that depends on it and wait.
  • A bug wrote wrong data: roll back the code so it stops. Then repair only the damaged rows. A full database restore is the last resort.

The short rule: customers blocked, roll back first. Not blocked, fix forward.

Why rolling back the code leaves the data alone

The trap is a release that changed the database: the older code may not understand the new tables.

So database changes only add: a new table, a new column. A change that deletes data stops the release unless it is approved, one file at a time. The version before keeps working with the new tables, so rolling back the code never needs the data to go back with it.

More on how those changes ship safely: Real test data, locked-down production.

Five questions to ask your developer before launch

  1. How long does a rollback take, and who can do it? Seconds, and one named person, is a good answer.
  2. If a release changed the database, can you still roll back? Listen for “changes only add”.
  3. How old is the newest backup, and when did a restore last work? A backup nobody has restored is a hope.
  4. What do customers lose if the database goes back? Everything after the restore point. Do they know that?
  5. How do you hear that something broke? An uptime check and error alerts, not a customer email. More in Keep automations running unwatched.

You don’t need to run any of this yourself. I write the plan for your app, try the restore once, and hand you one page that answers these five.

The short version

Three moves: fix forward, roll back the code, restore the database. Customers blocked: roll back first. Not blocked: fix forward. The database goes back last, because it costs every customer their recent work. And a plan only counts once a restore has been tried.

If your app broke right now, who would roll it back, and how long would it take?

KNOWYOURWAYBACK

Tell me how your app goes live today and I'll tell you how fast you could undo a bad release, and what data you'd lose.

More Posts

All posts