Interview Prep/Kubernetes/Reliability & Rollouts

How do you ensure database migrations don't break rolling deployments?

IntermediateProductionReliability & Rollouts
Answer

Use expand/contract: ship backwards-compatible schema changes first (add columns, no drops), deploy code that works with old and new schema, then remove old structures in a later release. Run migrations as a pre-deploy Job or Helm hook rather than in every Pod's startup, and make them idempotent with locking.

All Kubernetes questions

More on Reliability & Rollouts