Database Changes in Live Systems.
Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
Search for a command to run...
Learner, Love to make things simple, Full Stack Developer, StackOverflower, Passionate about using machine learning, deep learning and AI
No comments yet. Be the first to comment.
Hard-earned lessons on why breaking changes cause real damage in production, and how experienced engineers design new features that respect the past.
How experienced teams ship changes safely—and recover when things go wrong Introduction: Production will always surprise you No matter how good your design is, production will surprise you. Real users behave differently Real data exposes edge cases...
Move beyond traditional RESTful thinking. Learn how to design APIs specifically for MCP (Model Context Protocol) servers. This guide covers the shift in mindset, a practical OpenAPI 3.1 example, and a Spring Boot implementation to make your services ...

Extending Kestra to Every Corner of Your Data Stack. Introduction: The Power of Plugins Imagine you're a master chef. You don't just have one knife - you have specialized tools for every task: a paring knife for delicate work, a chef's knife for chop...
Mastering Complex Orchestration Scenarios. Introduction: The Orchestrator's Toolkit Imagine you're conducting a symphony. You don't just wave your baton - you cue sections, adjust tempo, handle surprises, and ensure harmony. That's what advanced work...
From Data Extraction to Loading - A Practical Guide Introduction: Why ETL Still Matters in the Modern Data Stack Remember when data engineering was "extract, transform, load"? Some say ETL is dead, replaced by ELT, reverse ETL, and data mesh. But her...
Building Blocks of Declarative Orchestration. Introduction: The Power of Simplicity Imagine trying to build a house without understanding bricks, beams, and blueprints. That's what using an orchestration tool without understanding its core concepts f...
Why schema changes break production and how experienced teams avoid it.
You can redeploy code in minutes.
You can roll back services.
You can toggle feature flags.
But your database?
It remembers every decision you ever made.
Most production failures related to databases don’t come from performance or capacity.
They come from schema changes that didn’t respect existing data.
If APIs punish careless change, databases are unforgiving.
Database changes affect:
Running code
Historical data
Batch jobs
Reports
External integrations
And they do it all at once.
Unlike code, database changes are often:
Irreversible
Shared across services
Hard to test realistically
This is why experienced engineers treat database evolution as a slow, deliberate process.
There is no such thing as a small migration in production.
A single ALTER TABLE can:
Lock tables
Break reads
Corrupt assumptions
Expose hidden bugs
If a change touches existing data, it is not small.
NOT NULLYou add a new column:
ALTER TABLE orders
ADD COLUMN source_type VARCHAR(20) NOT NULL;
Looks reasonable.
But:
Old rows don’t have this value
Inserts fail
Reads fail
Reports fail
The system breaks in places you didn’t expect.
Add the column as nullable
Deploy code that handles NULL
Backfill existing data
Add NOT NULL constraint later
This is not overengineering.
This is production hygiene.
This pattern should be burned into memory.
Add new schema elements without breaking existing ones.
ADD COLUMN source_type VARCHAR(20);
Gradually update:
Old data
Old code paths
Old queries
Remove or restrict only after verification.
ALTER TABLE orders
ALTER COLUMN source_type SET NOT NULL;
Skipping steps is how outages happen.
Renaming feels harmless:
ALTER TABLE users
RENAME COLUMN mobile TO phone;
But:
Old code still queries mobile
Old reports fail
Old scripts break silently
Add new column phone
Keep both in sync
Update code gradually
Remove mobile later
Yes, it’s extra work.
So is recovering from production incidents.
Most schema changes fail because of old data, not new code.
Old data:
Has missing fields
Has unexpected values
Was created under different rules
Your new logic must handle:
Nulls
Defaults
Inconsistent formats
You add validation:
email must not be empty
But historical data contains:
email = ""
Now:
Reads fail
Jobs crash
Admin screens break
New rules must coexist with old reality.
Zero-downtime is not a tool.
It’s a mindset.
It means:
No locks that block traffic
No assumptions about clean data
No “quick fixes” during business hours
Rule:
If a migration cannot be safely paused or rolled back, it’s not ready.
Deploying code and schema together assumes:
No rollback
No partial failure
Perfect timing
Reality disagrees.
Schema first.
Code second.
Cleanup last.
Columns are rarely “unused”.
They are just used quietly.
Before deleting:
Log access
Search queries
Check reports
Wait longer than you think
Deletion is easy.
Recovery is not.
Large migrations fail mid-way.
Split them:
One change per script
One responsibility per migration
Clear rollback steps
Small migrations fail less catastrophically.
They:
Treat migrations as production code
Review them carefully
Test them on real-like data
Run them slowly and deliberately
They assume:
Data is messy
Code will be rolled back
Something will go wrong
And they plan accordingly.
Before touching the database, ask:
What old data exists?
What code reads this table?
Can this change be additive?
What happens if this runs slowly?
How do we roll back safely?
If rollback is unclear, stop.
Databases are honest.
They don’t care about deadlines, intentions, or confidence.
They only care about correctness.
If you respect existing data, databases will serve you well.
If you rush change, they will expose it—usually in production.
More such articles:
https://www.youtube.com/@maheshwarligade