Every deployment needs a rollback plan.
Rollback approaches:
- Kubernetes:
kubectl rollout undo deployment/myapp - Blue-green: Switch traffic back to old environment
- Feature flag: Disable the flag
- Database: Harder. Backward-compatible migrations help
Rollback triggers:
- Error rate exceeds threshold
- Latency p99 degrades
- Health check failures
- Manual trigger by on-call
Interview question: "Your deployment increased error rates from % to %. What do you do?"
Immediate rollback. Don't debug in production with elevated errors. Roll back first, then investigate in staging.