Glossary · R

Rollback

Returning an application, configuration or database to a previous known good state after a change has caused problems.

By Obseria TeamUpdated

Definition

A rollback is the return of an application, its configuration or its data to a previous known good state after a change has caused errors, performance problems or other harm. Rollbacks are a key recovery tool because they usually restore service faster than finding and fixing the bug. They work reliably only if previous versions are kept, database changes are backward compatible and teams can tell quickly from telemetry that a release is the cause.

What is a rollback?

A rollback undoes a change by returning to the last version that worked. In software delivery, it usually means redeploying the previous release of a service after the new one has increased the error rate, slowed down requests or broken a feature. The same idea applies to configuration, infrastructure, feature flags and, with more care, to databases.

The reason rollbacks matter is time. Diagnosing a bug under pressure can take hours. Returning to a known good version often takes minutes and stops the damage while the team investigates calmly. That is why many incident processes treat "roll back first, debug later" as the default when a recent deployment is the likely cause.

Rollback vs. roll forward

The alternative is a roll forward: fixing the problem with a new release instead of returning to the old one. Rolling forward makes sense when the fix is small and well understood, when the old version can no longer run, for example after an irreversible data migration, or when the pipeline is fast enough to ship a fix within minutes. Rolling back is the safer choice when the cause is unclear, when user impact is high or when the fix would need its own review and testing.

Rollback strategies

  • Redeploy the previous artifact: deploy the last container image or package again. This requires immutable, versioned artifacts that are kept for a while.
  • Switch traffic back: with blue-green deployment, the old environment is still running, and the router simply points back to it.
  • Stop a canary: in a canary deployment, only a small share of traffic reaches the new version, so the rollback affects few users and is quick.
  • Turn off a feature flag: if new behaviour is behind a feature flag, disabling the flag can be faster than any deployment.
  • Revert configuration: configuration changes need the same versioning and rollback path as code, because they are a frequent cause of incidents.

Example: rollback in Kubernetes and Helm

Kubernetes keeps a revision history for Deployments, so a rollout can be undone directly:

kubectl rollout history deployment/checkout
kubectl rollout undo deployment/checkout                 # previous revision
kubectl rollout undo deployment/checkout --to-revision=4
kubectl rollout status deployment/checkout

For applications deployed with Helm, helm history checkout lists the release revisions, and helm rollback checkout 4 returns to revision 4. If manifests are managed with GitOps, the cleaner way is often to revert the commit in Git, so the repository and the cluster do not drift apart.

The hard part: databases and state

Code is easy to roll back, data is not. If a release has run a migration that drops a column or changes a format, the previous version may no longer work with the database. The usual answer is the expand and contract pattern: first add new structures in a backward compatible way, deploy code that can work with both, migrate the data and only remove old structures in a later release. Every release then remains reversible. Similar care is needed for message formats, caches and external APIs that other services depend on.

Best practices

  • Practise rollbacks regularly, not only during incidents, so the procedure is known and fast.
  • Define rollback criteria in advance, for example a clear rise in error rate or a breach of the latency objective within the first minutes after a release.
  • Keep releases small, which makes it easier to identify the bad change and less painful to undo it.
  • Record every deployment and rollback with service, version and time, so the history is clear during and after an incident.
  • Follow up: a rollback restores service, but the cause still needs to be found and fixed, ideally documented in a postmortem.

The observability perspective

A rollback decision is only as good as the signal behind it. Teams need to see within minutes whether a release changed error rate, latency or throughput, ideally broken down by version, so the new version can be compared with the old one while both are running. Error budgets and SLOs give the decision a frame: a release that burns the error budget quickly is a strong case for rolling back. Rollbacks also feed delivery metrics: the DORA metrics count change failure rate and the time it takes to recover from a failed deployment, both of which improve when bad releases are detected and undone quickly. After the rollback, the same telemetry confirms that the system has actually recovered.

How Obseria helps

Obseria does not perform rollbacks itself and has no automatic rollback; the rollback stays in your pipeline or platform. What Obseria provides is the information to decide. Deployment tracking records releases by hand, through the deployments API from your CI/CD pipeline or via GitHub, and because the service.version attribute travels with spans, metrics and logs, response time, throughput and error rate can be filtered by version. Alert rules and burn-rate alerts in SLO monitoring react when a release makes things worse, and incident management keeps owners, status and timeline of the response in one place.

Frequently asked questions

A rollback returns to the previous working version. A roll forward fixes the problem with a new release. Rollbacks are usually safer when the cause is unclear; rolling forward fits small, well understood fixes or changes that cannot be undone.

Use kubectl rollout undo deployment/<name> to return to the previous revision, or add --to-revision for a specific one. With Helm, helm rollback <release> <revision> does the same for a release.

Only if they are designed for it. Destructive changes such as dropping columns are hard to reverse. The expand and contract pattern keeps each release backward compatible, so the application can be rolled back without losing data.

When a recent change is the likely cause of user impact and the fix is not immediately obvious. Defining criteria in advance, such as a clear rise in error rate after a release, makes the decision faster under pressure.

Put these concepts into practice

Try Obseria free for 14 days, with OpenTelemetry and no proprietary agents.