Blue-green deploys are trivial for stateless services — stand up green, flip the load balancer, done. The database is where the pattern falls apart.

You can’t blue-green a schema

Running two full database copies isn’t practical past a certain size, so blue and green environments have to share one database — which means every migration has to be backward-compatible with both the old and new application code, simultaneously.

Expand, migrate, contract

We settled on a strict three-phase pattern: expand the schema additively, deploy the code that can read both old and new shapes, then contract by dropping the old columns only after green has been running clean for a full day.

The rule that saved us

No single deploy is allowed to both add a column and start relying on it being populated. That gap is exactly where blue-green deploys against a shared database break.