Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Member-only story

Zero-Downtime Database Changes: The Multi-Deploy Strategy for Django

8 min readMay 29, 2026

--

Press enter or click to view image in full size
Zero-Downtime Schema Evolution

In Article #5, I told you about the migration that locked our orders table for 47 minutes. That article covered the basics — separate data migrations from schema changes, use atomic = False, batch your updates, create indexes concurrently.

But there’s a category of database changes that those rules don’t cover. The kind where no single migration is safe, no matter how carefully you write it. The kind that requires two, three, or even four separate deployments to complete safely.

Renaming a column. Changing a field type. Removing a table that old code still references. Moving data from one table to another. These changes can’t be done in one step without breaking the application that’s still serving traffic.

The pattern that solves this is called expand-contract — and once you understand it, you’ll never be afraid of a schema change again.

Press enter or click to view image in full size
Migration-Code Timing Mismatch

--

--

From Backend Developer to System Thinker

See more from me