Domain 3 β€” Module 10 of 12 83%
17 of 27 overall
Domain 3: Design and implement build and release pipelines Free ⏱ ~7 min read

Reliable Deployments: Order, Compatibility and the Hotfix Path

Sequence database and application changes, distinguish retry from recovery, and prepare a controlled route for urgent fixes.

You cannot use the bridge before its supports exist

Parallelism saves time only when tasks are independent. If a new API requires a database column, deploying both at once without compatibility planning creates a race. A job dependency fixes ordering, but it does not automatically make a destructive schema change safe.

Build a dependency graph that includes infrastructure, schema, application versions, configuration, and traffic. Identify irreversible actions and the evidence required before the next stage.

Expand, migrate, contract

Suppose a booking system needs to replace CustomerName with structured name fields.

PhaseChangeCompatibility requirement
ExpandAdd new nullable fields without removing the old oneExisting application still works
MigrateDeploy compatible code and backfill data carefullyOld/new versions can coexist as planned
SwitchMove reads/writes through reviewed release stepsObserve correctness and complete migration
ContractRemove obsolete field after consumers no longer depend on itOld versions are no longer rollback targets

This is a conceptual example, not a universal SQL script. Concurrency, backfill size, locks, dual-write consistency, and failure recovery depend on the database and application.

A safe pipeline might order:

validate infrastructure change
 -> apply compatible schema expansion
 -> deploy application to test target
 -> validate data and transaction behavior
 -> controlled production rollout
 -> later contract change under a separate decision

Do not delete the old field in the same early step simply because the new application no longer uses it. Rolling deployments and rollback can leave older processes active.

Implement the right deployment unit

UnitTypical mechanismEvidence to verify
ContainerManifest/task with reviewed image referenceDigest, rollout status, readiness, business smoke
Binary/packageDownload exact run artifact, then target-specific deployVersion, configuration, process health
ScriptReviewed idempotent or safely repeatable operationExit result plus actual target state
DatabaseMigration tool or SqlPackage/DACPAC as appropriateReviewed plan, data safety, post-change schema/application check

Azure’s Kubernetes manifest task can deploy manifests and check rollout stability. That does not validate every business dependency. SqlPackage can generate a deployment script/report before applying a DACPAC; inspect that plan for destructive changes rather than equating generation with approval.

Keep migration/deployment logs free of credentials. A script should fail explicitly when prerequisites are missing and leave useful diagnostics. Do not swallow an error and print β€œdeployment complete.”

Retry only when repeating is safe

A transient download failure can often be retried. A timed-out database operation may already have committed. Retrying it blindly can duplicate data or leave inconsistent state.

Use bounded retries with backoff for known transient failures. Make operations idempotent where possible, or add explicit checks for completion and partial state. Record which step changed what. A cleanup action must not delete the last healthy deployment merely because a later verification failed.

Separate rollback of application content from data recovery. Backups and restore procedures require tested recovery points and access; having a backup file is not proof that the service can be restored within the required time.

Prepare the hotfix route before an incident

Define which production version is the hotfix base, who authorizes it, which tests remain mandatory, how the artifact is identified, and how the fix is reconciled into the normal development line.

For a supported release branch, an urgent fix may be implemented there and backported or forward-integrated deliberately. Cherry-picking can apply a commit to another branch but can conflict or miss dependencies; inspect and test the resulting code.

Do not bypass every control because a change is small. A one-line configuration change can affect every customer. A good hotfix path reduces irrelevant delay without removing essential review, artifact identity, production health verification, and rollback planning.

AI assistance can summarize evidence or suggest recovery options. Require the exact failing stage and target state before authorizing a repeat or rollback.

Knowledge Check

A database migration timed out and its final state is unknown. What should the deployment do before retrying?

Try it: rehearse failure between steps

Prerequisites: a tabletop design or disposable local application/database. No production data. Cloud databases and clusters can incur charges if separately provisioned.

Draw an expand/migrate/contract sequence. Stop the imaginary run after each boundary and ask: which application versions still work, what has changed permanently, and what evidence is needed to continue? Write a hotfix reconciliation step back to the main development branch.

Expected observation: every partial state has a known response, and the contract step is separated from initial compatibility work.

Cleanup: remove only your local sandbox database and files through their normal lifecycle. Do not practice restore or destructive schema changes on shared environments.

Question

Why does dependency ordering not guarantee safe rollback?

Click or press Enter to reveal answer

Decision check: did the deployment really finish?

Check task status, target version, dependency health, and a safe customer transaction. None of those alone establishes all the others.

Read the source