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.
More on Reliability & Rollouts
What are the must-have settings for a production Deployment?BeginnerWhy use image digests or immutable tags instead of `latest`?BeginnerWhat does a PodDisruptionBudget protect and how do you size it?BeginnerHow do you set graceful shutdown right?BeginnerWhy do rollouts sometimes cause brief 502/503 errors?BeginnerHow many replicas should you run and how do you spread them?Beginner