How do you handle rollback when a release includes a non-reversible DB migration?
CI/CD & GitOps · Advanced level
Answer
If a release includes a non-reversible database migration, rollback cannot simply redeploy the old app. I avoid that with expand-contract design. If unavoidable, I use backups, forward-fix plans, compatibility windows, manual approval, feature flags, and a clear incident playbook.
Technical explanation
Safe release design assumes rollback may be needed and separates code deployment, data changes, and user exposure.
Compatibility windows and observability are mandatory when application and database versions overlap.
A secure pipeline protects source, build environment, dependencies, artifacts, deployment credentials, and runtime promotion gates as one chain.
Immutable artifacts, SBOMs, signatures, provenance, vulnerability gates, and environment promotion reduce ambiguity about what was built and deployed.
CI runners are high-value targets; isolate untrusted jobs, patch runner images, remove persistent credentials, and prefer ephemeral execution where possible.
Release safety depends on both automation and observability: use canaries, feature flags, rollback plans, and automated metric-based decisions.
Hands-on example
1. Design an advanced delivery exercise for: How do you handle rollback when a release includes a non-reversible DB migration using one service, one Git repository, one artifact registry, and one Kubernetes environment.
2. Implement an expand-contract migration: add nullable column/table first, deploy app compatible with old and new schema, backfill safely, then remove old schema in a later release.
3. Run the migration in a staging clone, measure duration and locks, add a pre-deploy backup checkpoint, and define a forward-fix plan for non-reversible steps.
4. Use progressive exposure where relevant: feature flag off by default, canary 5%, automated metric check for error rate and latency, then expand or rollback.
5. Record audit evidence: PR, approver, pipeline run, artifact digest, SBOM location, signature verification result, deployment event, and rollback or forward-fix decision.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More CI/CD & GitOps interview questions
- What is progressive delivery, and what tools enable it (Argo Rollouts, Flagger)?
- What recent CI/CD or GitOps practice have you adopted, and what improved?
- How would you migrate a team from Jenkins to GitOps with ArgoCD?
- How do you keep build agents and runner images patched and secure over time?
- How do you manage pipeline configuration across dozens of repositories?
- How do you audit who deployed what and when?
- How do you roll out a change to a subset of users or regions first?
- What is a canary analysis, and how do you automate the go/no-go decision?