Technical deep dive1 min readPublished Sep 10, 2026
The three-hour deploy that taught us to fear big-bang migrations
A database migration that should have taken twenty minutes, what actually went wrong, and the rollback plan that saved us.
We estimated a schema migration for a client's core orders table at twenty minutes of downtime, scheduled for a low-traffic window. It took just under three hours, and the only reason it ended in a working system rather than a much worse outcome was a rollback plan we almost skipped writing because we were confident the migration would go smoothly.
What actually happened
The migration added a non-nullable column with a computed default across a table with 40 million rows. In our staging environment, at roughly 2 million rows, this ran in under a minute. At production scale, the single transaction locking the table for the backfill ran far longer than expected, and every write to the orders table queued behind it.
Why staging did not catch this
Staging data was a two-year-old snapshot, twenty times smaller than production, and the migration's runtime scaled non-linearly with row count in a way that a 20x smaller test simply could not reveal. This is the single most common way we now see teams get burned by database migrations.
The rollback that saved us
We had, almost as an afterthought, written a reversible migration and tested the rollback path in staging. When it became clear the forward migration would not complete in the maintenance window, we rolled back cleanly in under four minutes and re-planned the migration as a batched, non-locking backfill instead.
Test migrations against a production-scale row count, or a representative sample at real scale, not just a small staging snapshot.
Every migration needs a tested rollback path, even ones you are confident about — especially the ones you are confident about.
Batch large backfills instead of running them as a single locking transaction, regardless of how well it performs in staging.
Continue exploring
We migrated 40 services to a monorepo. Here is the honest ledger.
Eighteen months in, the costs and benefits side by side. Not a recommendation either way.
What we check before recommending Kubernetes to a client
A short checklist we run before every infrastructure proposal, because the honest answer is often 'not yet.'
Our on-call rotation before and after we started tracking MTTR
We assumed our incident response was fine because nobody complained. The data said otherwise.
How to build a workflow you can actually inspect
A walkthrough of building your first automation in Nodesin, and why every step, its inputs and outputs, and the bill remain visible.
Explore this topic
DevOps
Related experts
Tomás Reyes
Security engineer at Halden. Email security, phishing programmes and the controls small companies skip.
5 articles
Sebastian Terri
Making Complex Technology Easier to Understand
1 article

