Application release and configuration
A release is more than new code
A release is an identifiable application artifact together with the configuration and dependency assumptions that allow it to run. Deployment installs or starts it; promotion makes it serve intended users. You can deploy a candidate, test it, and only then promote it. Preserve an earlier known-good artifact and record which settings, credentials references and database schema it requires.
The Byte Books application from the preceding lesson has a public synthetic catalog and /health. Version v2 changes the display name but retains the response fields. The team wants to validate v2 before users receive it. A staged release is a useful approach because a successful build does not prove the live route works.
Separate configuration from the artifact
Use environment-specific configuration such as a display name, log level or database endpoint. Use a managed secret reference and workload identity for sensitive values where supported. Do not print the environment, put secret values in URLs, or bake them into images. A change to a setting can cause restart or a new revision; consult the selected platform. Record nonsecret settings and secret reference identifiers, not their values.
Illustrative deployment inventory (not an API payload):
{ "artifact": "book-api-v2", "environment": "staging", "settings": { "STORE_NAME": "Byte Books Preview", "RELEASE": "v2" }, "database": "synthetic-only", "publicAccess": false}In production use the same verified artifact with production-approved settings. Do not deploy the example JSON as a provider manifest. Check that the release identifier comes from the actual artifact metadata or controlled configuration; never rely only on an editable display label to prove which code is running. Keep access and secret references separate from the app build.
Deployment mechanisms are not interchangeable
| Provider mechanism | Staged release idea | Critical qualification |
|---|---|---|
| Elastic Beanstalk deployment policy | Deploy a version using rolling, immutable or traffic-splitting strategy where supported | Policies differ in temporary capacity, health evaluation and failure behavior; verify environment type |
| Azure App Service deployment slots | Deploy to staging, validate, then swap to production | Slots depend on plan; some settings stay with the slot, including settings marked slot-specific; check network, identity and configuration behavior before swapping |
| Cloud Run service revisions | Create a candidate revision with no normal traffic; test through an authorized route, then shift traffic | Revisions are immutable; configuration changes can create new revisions; traffic tags and minimum instances may incur charges |
A slot is a named hosting environment, not simply another immutable revision. A rolling deployment updates batches; an immutable update builds replacement capacity. Blue/green keeps two environments during transition. A canary exposes a limited share of traffic to a candidate. The mechanisms can overlap but have different semantics. A DNS-weighted migration is not exact per-request traffic splitting because resolver caching and client behavior affect routing. Do not promise zero downtime merely because one of these mechanisms is used.
Worked canary decision
Use observed counts, not only a global average. In a synthetic window, v1 receives 900 requests with 9 errors; v2 receives 100 requests with 8 errors. v1 error rate = 9/900 = 1%; v2 error rate = 8/100 = 8%. Overall error rate = 17/1000 = 1.7%. A global target of 2% would hide the candidate problem. In this example the release rule requires at least 100 candidate requests, at most 2% candidate errors, and p95 latency at most 250 ms. Candidate p95 is 210 ms but its error rate fails. Stop promotion and route new traffic back to the known-good release, then verify recovery. The thresholds are fictional teaching choices, not universal SLOs.
A small sample or no candidate traffic is inconclusive, not success. Check representative workload, dependency errors and business invariants as well as latency. A percentage of traffic is a target, not a guarantee of exact counts. A candidate may need additional capacity while both releases operate; if two baseline instances and two temporary candidate instances run for 3 hours at $0.08 per instance-hour, modeled total compute is $0.96, versus $0.48 for baseline alone.
Rollback and database compatibility
A rollback restores an earlier application route or release. It does not automatically undo database writes, external notifications, cache changes, secrets rotation or schema migrations. Before deployment, verify that the old and new code can both use the current database schema. For example, introduce a nullable new column, deploy code compatible with both schemas, backfill carefully, and only remove the old field after older releases are no longer required. A destructive schema change requires its own approved recovery plan; do not blindly roll back code against an incompatible schema.
If a candidate fails, freeze rollout, restore the last validated traffic configuration if compatible, verify user-facing responses and error rates, and preserve evidence. If rollback is unsafe, use the rehearsed recovery plan or a corrective release. If a cloud operation reports success, still confirm application functionality. For TLS and domain issues, inspect DNS, certificates and origin routing independently.
Practice a release without an account
Use the same Python handler locally with v1 and v2 synthetic settings. Predict responses at /books and /missing. Plan a staging check, a small candidate rollout and a stop condition. Specify the traffic and latency observations you need, the rollback artifact, compatible database state and what would make rollback unsafe. Verify that staging cannot access production secrets or private data. Keep test output free of credentials.
In a future authorized sandbox, inventory and remove only lab-owned hosting environments, candidate revisions where appropriate, unused artifacts, log resources and networking dependencies after the rollback window. Preserve production and shared resources; some storage and plan charges continue after traffic stops. Verify actual billing and cleanup separately. The offline exercise performs none of these cloud operations.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Application release and configuration — knowledge check
Choose the best answer for each offline scenario.
A candidate gets 8 errors in 100 requests; the overall service error rate is 1.7%. Candidate threshold is 2%. What is the decision?
Which statement about a Cloud Run service revision is correct?
Where should a sensitive database credential be configured?
A candidate removes a database field that the old code requires. What should happen before code rollback?
The candidate receives no requests during the evaluation window. What does its zero error count mean?