Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • October
  • 20
  • Database Migrations Need to Survive Two App Versions at Once

Database Migrations Need to Survive Two App Versions at Once

Posted on October 20, 2026 By
Programming

A database migration can work perfectly on your development machine and still make a production deployment awkward. During a rolling release, some application instances may be running the old code while others use the new code. If the schema change immediately removes something the old version expects, the deployment order becomes a trap.

The expand-and-contract approach separates adding the new structure from removing the old one. Introduce a compatible shape, move the application and data across, then remove the obsolete structure when it is genuinely unused. It creates more than one step, but each step has a clearer relationship with the code currently running.

I would pay particular attention to data written during the transition. A backfill of yesterday’s rows does not automatically handle today’s new writes, and a rollback may be useless if the older application cannot understand the updated records. Decide how those cases work before treating a successful migration command as proof that the release is safe.

Small deployments are easier to manage when the database lets the application move gradually. The aim is a change you can explain and recover from, with checks at each boundary. Saving one migration file is not worth making every instance switch versions at exactly the same moment.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: database-migrations deployments prisma

Post navigation

❮ Previous Post: Every Mundane Task Deserves an Overdramatic Soundtrack

You may also like

Programming
PHPNW 09 – Food and Optimising front end performance
October 10, 2009
Programming
#PHPUK2010 Part 2 (MySQL stuff)
February 26, 2010
Programming
C# 14 field-backed Properties Are Small but Useful
June 7, 2026
Hardware
Superb VPS (Virtual Private Server) Provider – VPS.net Review
November 18, 2009
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown