Deployment Rollback Strategies

Design rollback-capable deployment pipelines and untangle database migrations from code deployments.

Overview

Overview

The most reliable systems treat rollback as a design goal, not an edge case: fast, tested and almost automatic. The core challenge is that code and data roll back differently. Code swaps instantly; schema changes are often hard or impossible to reverse safely.

So the first question after a bad deploy is what changed. If only code changed, redeploy the previous artifact, which is instant. If the feature sits behind a flag, turn the flag off. If the deploy made a destructive schema change, there is no safe reverse, and the only way out is a forward-only fix.

Key concepts

  • Expand/Contract Pattern
  • Forward-Only Migration
  • Blue/Green Deployment
  • Feature Flag
  • Automatic Rollback Threshold

Interview questions

  • You need to rename a column in a high-traffic PostgreSQL table from user_name to username. How do you do this safely with zero downtime and the ability to roll back?

Sign up free to read the full topic

More Troubleshooting topics

Start free on Cariara · Coding problems · System design studio