Lesson 9 of 9 · 22m
Upgrades, Rollbacks, and Operational Runbooks
Operate the service after release: controlled upgrades, dependency patching, rollback judgment, incident notes, and runbooks that reduce panic-driven mistakes.
The most dangerous production system is the one nobody wants to touch. Dependencies age, certificates expire, Spring patch releases accumulate, and every postponed upgrade makes the next one scarier. Operational maturity is not heroics during incidents. It is the boring ability to change the system safely on a Tuesday.
Upgrades need a compatibility lens
A Spring Boot upgrade is rarely just a version number. It can alter dependency versions, default behavior, actuator security, validation semantics, test annotations, and deprecated APIs. Read the release notes before touching the build:
./mvnw versions:display-dependency-updates
./mvnw -ntp testThen run the application locally or in staging with production-shaped configuration. Startup success is not enough; test critical workflows, metrics emission, authentication, database migration behavior, and external client contracts.
Patch vulnerabilities without blind upgrades
Security teams often demand immediate dependency upgrades, while engineering fears breaking production. Both instincts are rational. Use a vulnerability report with reachability and exploit context where possible. If a dependency cannot be upgraded immediately, document compensating controls and an expiry date. 'Accepted forever because nobody remembered' is not risk management.
Rollback is a decision, not a button
Rollback makes sense when the artifact is bad and the data shape remains compatible. It is dangerous when schema migrations, irreversible side effects, or poisoned messages are involved. Ask:
Did the deploy change persistent state shape?
Did it emit events consumed downstream?
Did it create customer-visible obligations?
Can the old version read data written by the new version?
Is rollback safer than rolling forward?Rolling forward is often the correct answer when the defect is isolated and a fix is quick. The point is not pride; it is avoiding a second unknown state transition while incident pressure is high.
Runbooks should fit on one screen
A useful runbook starts with symptoms, immediate checks, mitigation, escalation, and recovery validation:
Symptom: checkout error rate above 3% for five minutes
1. Confirm deploy marker and current version.
2. Check payment dependency latency and error mix.
3. If new version correlates, halt rollout or shift traffic.
4. If dependency outage, enable degraded checkout for non-critical methods.
5. Verify recovery with successful checkout metrics, not only pod health.Do not write a novel. During an incident nobody reads four pages of architecture history before learning which dashboard matters.
Incident reviews are operational feedback
After recovery, capture timeline, detection gap, mitigation quality, contributing causes, and concrete prevention work. Blameless does not mean causeless. If a missing test would have caught the defect, write it. If telemetry was ambiguous, fix the telemetry. If the rollback path was unsafe, change the migration pattern.
Field notes
- Do not call every mitigation a rollback; traffic shifting, feature-flag disabling, dependency failover, and scaling are different tools.
- Keep a known-good artifact identifier visible in deployment tooling. During stress, nobody should hunt through CI history.
- Restore tests matter more than backup success messages. A backup that cannot restore is storage, not resilience.
- Automate repetitive runbook steps only after the manual decision criteria are understood.
- If an upgrade requires manual production console edits, the process is not repeatable enough to be safe.
Was this lesson helpful?