Where should database migrations run in a pipeline?
AdvancedConceptCI/CD
Answer
As a separate, single-run step before the new app version rolls out (a Kubernetes Job or Helm pre-upgrade hook), and backward compatible with the old version through expand/contract. Don't run them in every replica's startup.
More on CI/CD
CI vs continuous delivery vs continuous deployment?BeginnerWhat is an artifact, and why "build once, deploy many"?IntermediateWhat are the DORA metrics?IntermediateBlue/green vs canary vs rolling?IntermediateWhat is GitOps in one sentence?BeginnerJenkins declarative vs scripted pipeline?Intermediate