Release rollback and schema compatibility
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Fictional releases (labels are not real digests):R1: image A, config C1, schema 3R2: image B, config C2, schema 4Migration 3 -> 4: adds nullable field; compatibility tested with R1Alternative migration: removes field required by R1Failure: R2 acceptance transaction failsCase A: review tested R1/schema 4 compatibilityCase B: stop promotion; data-safe recovery plan requiredKeep an approved release bundle containing actual immutable image references, configuration and compatible migration revisions. Prefer expand/contract migrations when feasible: add compatible structures first, migrate consumers and remove old structures only in a later controlled release. Case A may allow an application rollback if data writes, config and old code are all compatible; verify with acceptance tests after the change. Case B cannot be solved safely by blindly starting the old image. Choose a tested forward fix or restore/recovery procedure with explicit data-loss approval; a restore can discard recent writes. Compose up can recreate a service after its image or config changes, but a separate operator or delivery system must decide when and what to roll back. Restart alone does not apply changed configuration. Even an additive nullable field is not a universal compatibility guarantee: verify old readers, writers, constraints and configuration against the migrated database. Preserve new writes and an independently restorable backup; rollback approval must cover both code and data behavior.
Common mistake
Do not equate an image rollback with a database rollback. Check compatibility and preserve data before changing either.
Manual practice
Classify both migration cases. Write the evidence required before restoring R1 and the acceptance tests after recovery. Include a decision owner and explicit data-loss boundary.
Worksheet: lab-fixtures/docker-production-deployment/08-rollback/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Release rollback and schema compatibility — Knowledge check
Interpret production deployment evidence and make a safe operational decision.
Why is the old image insufficient for rollback?
Which migration is a possible rollback candidate?
What risk accompanies restoring an earlier database copy?