Rollback
Откат
A rollback restores an earlier working version or configuration of a service. Teams use it to recover from a bad change without waiting for a fix.
What a rollback does
Suppose a new checkout release starts returning errors to customers. Rather than debug the release while orders are failing, the on-call engineer can put the previous working version back into service. The goal is to restore checkout, not to rewind everything that happened after deployment. Orders that went through successfully should still be there.
How teams roll back a release
The quickest option depends on what changed and how it was deployed. In a blue-green deployment, the previous version may still be running, so recovery can be as simple as routing traffic back to it. During a canary release, the team can stop sending requests to the canary if the stable version can handle the full load. If the old version is no longer running, the team can redeploy the exact artifact it ran before, such as a container image identified by its digest. A bad configuration change may only require restoring the previous settings.
Before shipping, teams decide what to keep, which signals justify stopping or reversing a rollout, and how to verify recovery. A sustained increase in error rate or latency after a rollout is one possible trigger. Some delivery pipelines roll back automatically when configured checks fail; other teams leave that decision to the on-call engineer.
Example: Kubernetes
If a Deployment named checkout has just rolled out a faulty image, and the previous revision is still available and safe to run, an operator can use:
kubectl rollout undo deployment/checkout
kubectl rollout status deployment/checkout
The first command restores the previous revision's Pod template. The second tracks rollout progress. A successful rollout is not proof that checkout works: watch the error rate and run a smoke test of the checkout path. Undoing a Deployment does not undo a database migration or restore the contents of a ConfigMap that was edited separately.
When going back is the wrong move
Always ask what the new release changed outside the application itself. If a migration dropped a column the old code still reads, redeploying the old image can trade one outage for another. Changes to data formats can pose the same problem even when the schema has not changed. To keep rollback possible, teams often make database changes in stages: add the new structure in a way both versions can tolerate, then remove the old structure once the rollback window has passed.
If the old version cannot safely run against the current state, rolling forward with a targeted fix may be safer. If the bug is confined to a feature behind a flag, turning it off may restore service without replacing the running version at all.
How it comes up in interviews
An interviewer may ask, “Error rates jumped after a release that included a database migration. Would you roll back?” Start by explaining what you would check: whether the earlier build is available, whether it can read and write the current data safely, and whether switching traffic is faster than redeploying. Finish by saying how you would confirm that the affected user flow recovered.