Async Database Schema Change Guide eBook
Document schema changes, migration plans, and roll
by Vidal Mika
Document schema changes, migration plans, and rollback procedures asynchronously for team review.
Formats
Free sample
Chapter 1: The Friday Freeze--–- It was 3:47 PM on a Friday when Maya’s phone buzzed with the message every on-call engineer dreads: “Orders table is locked. Customers can’t checkout. Revenue dropping.” She had done everything right — or so she thought. The ALTER TABLE orders ADD COLUMN priority_flag TINYINT(1) had passed peer review, been tested in staging, and looked completely harmless. But the orders table had 847 million rows, and My SQL decided to copy the entire table to disk before adding the column.
Forty-three minutes later, the lock was still holding. The company lost an estimated $94,000 in abandoned carts. Maya spent her weekend writing an incident report and wondering if she should update her resume.The Hidden Tax Nobody Talks About This story is not unique. In fact, variations of it play out every single week in companies of all sizes — from five-person startups to Fortune 500 enterprises. The details change — the database might be Postgre SQL instead of My SQL, the table might be called transactions instead of orders, the engineer might be named Alex instead of Maya — but the underlying pattern remains disturbingly consistent: a routine schema change triggers an unexpected production incident, and everyone asks the same question afterward: “How did we not see this coming?”The answer, uncomfortable as it may be, is that most engineering organizations have built their database change processes around an assumption that stopped being true years ago: the assumption that schema changes are rare, simple, and can be coordinated in real time.The Pre-Cloud Era and Its Scars To understand why this assumption persists, we need to briefly visit the not-so-distant past.
Ten or fifteen years ago, database schema changes looked fundamentally different than they do today. Application deployments happened monthly, or even quarterly. Teams were smaller. The “DBA” — Database Administrator — was a distinct role, often gatekeeping access to production. A schema change request meant filling out a Jira ticket, scheduling a meeting with the DBA review board, and getting a time slot — usually on a Thursday night — to run your ALTER statements while the application was in maintenance mode.That model, for all its slowness and ceremony, had a perverse kind of predictability.
When you only change the schema four times a year, you can afford to lock tables for an hour. When your application is offline during the change, nobody notices the downtime because you scheduled it for 2 AM.Then the world changed.Continuous delivery became the standard. Microservices exploded. Teams went from one database to dozens. The pace of schema changes went from weekly to multiple times per day.
But the mental model for how to safely change a database — the actual process in most engineers’ heads — never caught up.Today, we treat database migrations the same way we treat code changes. We open a pull request, get a quick review from a colleague, and merge. The problem is that code and schemas are not the same thing. Not even close.Why Your Database Hates Your Git Workflow Let’s talk about the fundamental difference that most engineers learn the hard way. Application code is, for the most part, stateless.
When you deploy a new version of your backend service, you spin down the old containers and spin up new ones. If something goes wrong, you roll back by redeploying the previous version. The data — the actual state of your system — sits safely in the database, untouched by the code deployment.A schema change, by contrast, reaches directly into the state. When you ALTER TABLE users ADD COLUMN timezone VARCHAR(64), you are not just changing instructions; you are changing data structures that may hold hundreds of gigabytes of customer information. And unlike a code rollback, which is a simple git revert and redeploy away, rolling back a schema change often means:Running another ALTER statement (which may also lock the table)Accepting that data written to the new column during the brief window will be lost Coordinating the rollback with multiple application versions still running This asymmetry — code is cheap to change, schema is expensive to revert — creates the central tension that this entire book exists to resolve.
Traditional, synchronous review processes try to mitigate this risk by adding more human eyes to each change. More meetings. More approvals. More Friday freezes.But here is the uncomfortable truth: more meetings do not make schema changes safer. They just make them slower.The Speed-Safety Paradox Almost every engineering leader has experienced some version of the following conversation:Engineering Manager: “We need to ship feature X faster.
Why is the database change taking three days to approve?”DBA: “Because last time we rushed a schema change, we had a four-hour outage. We’re being careful.”Both sides are right. The manager is right that slow processes hurt competitiveness. The DBA is right that unsafe changes hurt reliability. This is the speed-safety paradox, and it has no solution within the traditional synchronous review model because the model itself is the problem.When you require a real-time meeting to approve every schema change, you create unnatural bottlenecks.
People have different schedules. Reviewers are busy. The DBA is on vacation. The team in the opposite time zone won’t be awake for another six hours. So changes pile up.
Deploys get batched. And batching — grouping multiple schema changes into a single release — dramatically increases risk, because now you have to roll back all of them if one fails.The solution is not to review faster. The solution is to review differently.What “Asynchronous” Actually Means in This Book Before we go any further, we need to be extremely clear about a term that will appear on nearly every page of this book: asynchronous. In the context of database schema changes, this word carries two related but distinct meanings, and confusing them has caused no end of miscommunication.The first meaning — and the primary focus of Parts I, II, and V of this book — is asynchronous collaboration. This means that humans do not need to be in the same room (or the same Zoom call) at the same time to make progress on a schema change.
Instead of a live meeting where everyone stares at a SQL statement together, we use documents, pull requests, checklists, and automation to move the change forward on each person’s own schedule. A reviewer in Singapore can comment on a change at 9 AM their time; the author in San Francisco can respond when they wake up. No calendars were synchronized. No meeting was scheduled. The work happened asynchronously.The second meaning — covered in depth in Part III of this book — is asynchronous execution.
This means that the database performs the migration in the background, without blocking reads or writes. Tools like gh-ost and pt-online-schema-change (which we will explore in Chapter 7) copy data in small chunks, allowing the application to continue operating normally while the schema evolves. From the application’s perspective, the migration happens asynchronously — it just starts and finishes sometime later, with no downtime in between.Throughout this book, when we say “asynchronous,” we will specify which meaning we intend. For the remainder of this chapter, we are focused on asynchronous collaboration — the human process…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Vidal Mika
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Business Brief, Database, DevOps
- Released
- 2026-06-10
- Pages (approx.)
- 141
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Vidal Mika
EQ for CoachesVidal Mika$11.99
TM Athlete PerformanceVidal Mika$11.99
Opioid Use and Hepatitis CVidal Mika$11.99
Imposter Syndrome in Medical ProfessionalsVidal Mika$11.99
Pill Poppers & Power: The Fall of Insys TherapeuticsVidal Mika$11.99
The Phantom Fleet of the Great Lakes: The Lost Ships of 1913Vidal Mika$11.99
How to Start a Presbyterian Church of Wales Business (Beginners Guide)Vidal Mika$11.99
Referral Program Free GuideVidal Mika$12.99
HVAC Maintenance Lease UpdateVidal Mika$12.99
Fabrication Machine OperatorVidal Mika$11.99
Understanding Cranioacrofacial SyndromeVidal Mika$17.99