Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 4 of 6 · Lab · 30 min · revision 2

Lab: Preview Deploys, Zero-Downtime Release and Rollback

Give a pull request its own preview deployment, release a new version with a blue-green switch while traffic flows, send a canary a tenth of the traffic, let a scripted go/no-go check judge it from proxy metrics and application logs against explicit criteria, and roll back the bad release to the previous digest.

Contentsand lesson path

What you will learn

  • Expose health and readiness checks and release a new version with zero downtime (rolling, blue-green or canary), then roll back a bad release.
  • Verify a deploy with logs and metrics against explicit pass criteria before declaring it complete.

Prerequisites: Containerization

01. Goal and setup

In lab 3 one instance ran behind Caddy. Now you ship two versions and measure whether clients see any failed request while traffic moves: 1.1.0 gets a preview deployment for its pull request and then a blue-green release, and 1.2.0, which hides a bug, goes out as a canary to 10% of traffic. A go/no-go script judges each release against criteria written down in advance, from the proxy's access log and the application log, and you roll back the release it rejects.

Work in notes-api from lab 3 with its virtual environment active, the local-registry container running and API_IMAGE still holding the 1.0.0 digest (repeat lab 3's export in a new terminal). The scripts use only the Python standard library. The lab was tested with the versions of lab 3 (Docker Engine 29.8, Compose 5.5, Caddy 2.11.7, registry:3.1.2, python:3.12-slim, FastAPI 0.146, uvicorn 0.54). SHAs, digests, timings and counts in the outputs below differ on your machine. The folder from lab 3 gains these files:

Folder layout (new or changed files only)
notes-api/
├── app/main.py            step 3 and step 5 change list_notes
├── caddy/Caddyfile        step 1: imports upstreams.caddy
├── caddy/upstreams.caddy  written by route.sh
├── compose.yaml           step 1: two slots, blue and green
├── compose.preview.yaml   step 3: the preview deployment
├── route.sh               step 1: switch or split the traffic
├── verify_release.py      step 2: the go/no-go check
└── load.py                step 4: traffic for the checks

02. Step 1: Two slots behind the proxy

Blue-green needs two slots, two copies of the service that can run different versions side by side, and a way to tell the proxy which one gets traffic. Stop lab 3's stack first; the caddy_data volume and its certificate authority stay. Then replace compose.yaml:

Terminal
docker compose down
YAML · compose.yaml
x-api: &api
  env_file: config/prod.env
  secrets:
    - llm_api_key
  restart: unless-stopped

services:
  api-blue:
    <<: *api
    image: ${BLUE_IMAGE:?set BLUE_IMAGE}
    ports:
      - "127.0.0.1:9001:8000"  # direct access for smoke tests only

  api-green:
    <<: *api
    image: ${GREEN_IMAGE:?set GREEN_IMAGE}
    ports:
      - "127.0.0.1:9002:8000"

  proxy:
    image: caddy:2.11.7-alpine
    ports:
      - "8080:80"
      - "8443:443"
    volumes:
      - ./caddy:/etc/caddy:ro
      - caddy_data:/data

secrets:
  llm_api_key:
    file: ./secrets/llm_api_key

volumes:
  caddy_data:

Each slot publishes its port on 127.0.0.1 only, so you can smoke-test a slot directly before it gets any traffic. The site block of the Caddyfile now imports its upstreams from a separate file, which a script rewrites:

caddy/Caddyfile
{
	skip_install_trust
}

api.localhost {
	tls internal
	log {
		output stdout
		format json
	}
	import upstreams.caddy
}
Bash · route.sh
#!/usr/bin/env bash
# Send all traffic to one slot, or split it for a canary, then reload Caddy.
# Usage: ./route.sh blue | ./route.sh green | ./route.sh green blue 10
set -euo pipefail
stable=$1 canary=${2:-} percent=${3:-0}
upstreams="api-$stable:8000" policy=""
if [[ -n $canary ]]; then
  upstreams="$upstreams api-$canary:8000"
  policy="lb_policy weighted_round_robin $((100 - percent)) $percent"
fi
cat > caddy/upstreams.caddy <<CADDY
reverse_proxy $upstreams {
	health_uri /readyz
	health_interval 2s
	health_timeout 1s
	lb_try_duration 5s
	$policy
}
CADDY
reload=(docker compose exec -T proxy caddy reload --config /etc/caddy/Caddyfile)
if docker compose ps --services --status running | grep -qx proxy; then
  if ! out=$("${reload[@]}" 2>&1); then echo "$out" >&2; exit 1; fi
fi
echo "$(date -u +%FT%TZ) -> $upstreams ${policy#lb_policy }" | tee -a releases.log

route.sh writes caddy/upstreams.caddy and asks the running Caddy to reload it. A reload swaps the configuration without closing the listening sockets, and requests already in flight finish on the old configuration. With two slots and weighted_round_robin, it splits traffic by weight. Every change is appended to releases.log, a minimal deploy history. Start both slots on 1.0.0, with blue serving:

Terminal
printf 'caddy/upstreams.caddy\nreleases.log\n' >> .gitignore
chmod +x route.sh
export V100=$API_IMAGE BLUE_IMAGE=$API_IMAGE GREEN_IMAGE=$API_IMAGE
./route.sh blue
docker compose up -d --wait
docker compose ps --format 'table {{.Service}}\t{{.Status}}'
curl -s -w '\n' --cacert caddy-root.crt https://api.localhost:8443/version
Illustrative output (progress lines left out; times differ)
2026-10-19T14:28:44Z -> api-blue:8000
...
SERVICE     STATUS
api-blue    Up 9 seconds (healthy)
api-green   Up 10 seconds (healthy)
proxy       Up 9 seconds
{"version":"1.0.0","git_sha":"abb14cc"}

03. Step 2: Write the go/no-go check first

Decide what done means before you release, not while you stare at a dashboard. The criteria below are explicit numbers over an explicit window, and the script exits with status 0 (go) or 1 (no-go), so a pipeline can act on it:

Python · verify_release.py
"""Go/no-go check for one version: smoke tests, then proxy metrics and app logs."""

import argparse
import json
import statistics
import subprocess
import sys
import urllib.request

# Pass criteria, agreed before the release
MIN_REQUESTS = 100  # enough traffic in the window to judge
MAX_5XX_RATE = 0.01  # at most 1% server errors
MAX_P95_MS = 250  # 95% of requests faster than this, measured at the proxy
MAX_ERROR_LOGS = 0  # no ERROR lines from the new version

parser = argparse.ArgumentParser()
parser.add_argument("--version", required=True)  # the version under test
parser.add_argument("--service", required=True)  # its Compose service
parser.add_argument("--direct-url", required=True)  # the instance, bypassing the proxy
parser.add_argument("--since")  # window start, e.g. 2026-10-19T14:20:00Z
args = parser.parse_args()
failures = []


def check(ok, label):
    print(f"  {'ok  ' if ok else 'FAIL'}  {label}")
    if not ok:
        failures.append(label)


def get_json(path):
    with urllib.request.urlopen(args.direct_url + path, timeout=5) as response:
        return json.load(response)


def logs(service):
    cmd = ["docker", "compose", "logs", "--no-log-prefix", "--since", args.since]
    result = subprocess.run([*cmd, service], capture_output=True, text=True, check=True)
    return result.stdout.splitlines()


print(f"smoke tests against {args.direct_url}")
try:
    check(get_json("/readyz") == {"status": "ready"}, "/readyz is ready")
    check(get_json("/version")["version"] == args.version, f"version is {args.version}")
    check(len(get_json("/api/notes?limit=3")) == 3, "/api/notes?limit=3 gives 3 notes")
except OSError as error:  # urllib's HTTPError is an OSError too
    check(False, f"smoke request failed: {error}")

if args.since:
    durations, server_errors = [], 0
    for line in logs("proxy"):
        entry = json.loads(line) if line.startswith("{") else {}
        if args.version in entry.get("resp_headers", {}).get("X-App-Version", []):
            durations.append(entry["duration"] * 1000)
            server_errors += entry["status"] >= 500
    total = len(durations)
    rate = server_errors / total if total else 1.0
    p95 = statistics.quantiles(durations, n=20)[18] if total > 1 else float("inf")
    error_logs = sum(line.startswith("ERROR") for line in logs(args.service))
    print(f"window from {args.since}: {total} requests answered by {args.version}")
    check(total >= MIN_REQUESTS, f"requests {total} >= {MIN_REQUESTS}")
    check(rate <= MAX_5XX_RATE, f"5xx rate {rate:.2%} <= {MAX_5XX_RATE:.0%}")
    check(p95 <= MAX_P95_MS, f"p95 latency {p95:.0f} ms <= {MAX_P95_MS} ms")
    check(error_logs <= MAX_ERROR_LOGS, f"ERROR log lines {error_logs} <= 0")

print("NO-GO: " + "; ".join(failures) if failures else f"GO: {args.version} passed")
sys.exit(1 if failures else 0)
  • Smoke tests call the instance directly, bypassing the proxy: is it ready, is it the intended version, does a core route work?
  • Metrics come from Caddy's JSON access log, one line per request with status, duration and the response headers. The script keeps the lines whose X-App-Version names the version under test and computes the share of 5xx responses and the 95th percentile latency (p95: 95% of requests were faster). Counting by version is what makes a canary that serves only part of the traffic measurable.
  • Logs of the new slot must hold no ERROR lines in the window.
  • A minimum sample of 100 requests stops a quiet window from passing by default. A window that is too small also prints NO-GO, but that NO-GO means not proven yet: extend the window instead of rolling back.

In production the same checks read your metrics system, for example a Prometheus query over a 10 to 30 minute window, with real users instead of a load script. Try the smoke tests on blue:

Terminal
python verify_release.py --version 1.0.0 --service api-blue \
  --direct-url http://127.0.0.1:9001
Expected output
smoke tests against http://127.0.0.1:9001
  ok    /readyz is ready
  ok    version is 1.0.0
  ok    /api/notes?limit=3 gives 3 notes
GO: 1.0.0 passed

04. Step 3: A preview deployment for a pull request

Version 1.1.0 adds a tag filter. Make the change on a branch, as you would for a pull request, and commit the new files on main first:

Terminal
git add -A && git commit -qm "Blue-green slots and release checks"
git switch -c feature/tag-filter
Python · app/main.py (replace list_notes)
@app.get("/api/notes")
def list_notes(
    limit: int = Query(default=5, ge=1, le=50), tag: str | None = None
) -> list[dict]:
    notes = [note for note in NOTES if tag is None or tag in note["tags"]]
    return notes[:limit]

A preview deployment is a short-lived, isolated copy of the service built from the pull request's commit, so reviewers can try the change before it merges. It needs its own name, its own address, its own configuration and a key that is worth nothing to an attacker. Here it is a separate Compose project:

config/preview.env
APP_ENV=preview
LOG_LEVEL=DEBUG
LLM_BASE_URL=https://llm.example.com
LLM_MODEL=claude-sonnet-5-5
YAML · compose.preview.yaml
# One isolated copy of the API per pull request: own project, port and secret.
name: notes-pr-${PR:?set PR to the pull request number}

services:
  api:
    image: ${PREVIEW_IMAGE:?set PREVIEW_IMAGE}
    env_file: config/preview.env
    secrets:
      - llm_api_key
    ports:
      - "127.0.0.1:${PREVIEW_PORT:-9100}:8000"

secrets:
  llm_api_key:
    file: ./secrets/preview_llm_api_key  # a low-privilege key, never production's
Terminal
git add -A && git commit -qm "Filter notes by tag"
SHA=$(git rev-parse --short HEAD)
docker build -q -t localhost:5000/notes-api:pr-7-$SHA \
  --build-arg APP_VERSION=pr-7 --build-arg GIT_SHA=$SHA .
docker push -q localhost:5000/notes-api:pr-7-$SHA
python -c "import secrets; print('preview-' + secrets.token_urlsafe(24))" \
  > secrets/preview_llm_api_key
chmod 644 secrets/preview_llm_api_key
export PR=7 PREVIEW_IMAGE=localhost:5000/notes-api:pr-7-$SHA
docker compose -f compose.preview.yaml up -d --wait
python verify_release.py --version pr-7 --service api --direct-url http://127.0.0.1:9100
curl -s -w '\n' 'http://127.0.0.1:9100/api/notes?tag=build'
docker compose -f compose.preview.yaml down
Illustrative output (shortened; IDs differ)
sha256:63181e5a0217…
localhost:5000/notes-api:pr-7-57cc811
...
 Container notes-pr-7-api-1 Healthy
smoke tests against http://127.0.0.1:9100
  ok    /readyz is ready
  ok    version is pr-7
  ok    /api/notes?limit=3 gives 3 notes
GO: pr-7 passed
[{"id":2,"title":"Pin the base image","tags":["build"]}]
...
 Network notes-pr-7_default Removed

The preview image says pr-7 and is never promoted: it was built for review. On a real platform, CI repeats these steps on every push to the pull request (build, push, deploy to an address such as pr-7.preview.example.com, post the link) and deletes the deployment when the pull request closes. Static and edge hosts and several PaaS hosts offer this built in.

05. Step 4: Blue-green release under load

The pull request is approved. Merge it, tag the release and build the release image once, from the merged commit. Then start green on the new digest while blue keeps serving, and smoke-test green directly:

Terminal
git switch main && git merge --ff-only feature/tag-filter
git tag -a v1.1.0 -m "Release 1.1.0" && SHA=$(git rev-parse --short HEAD)
docker build -q --build-arg APP_VERSION=1.1.0 --build-arg GIT_SHA=$SHA \
  -t localhost:5000/notes-api:1.1.0 -t localhost:5000/notes-api:sha-$SHA .
docker push -q localhost:5000/notes-api:1.1.0
docker push -q localhost:5000/notes-api:sha-$SHA
export V110=$(docker image inspect localhost:5000/notes-api:1.1.0 \
  --format '{{index .RepoDigests 0}}')
export GREEN_IMAGE=$V110
docker compose up -d --wait api-green
python verify_release.py --version 1.1.0 --service api-green \
  --direct-url http://127.0.0.1:9002
Expected output (build and push lines left out)
...
 Container notes-api-api-green-1 Healthy
smoke tests against http://127.0.0.1:9002
  ok    /readyz is ready
  ok    version is 1.1.0
  ok    /api/notes?limit=3 gives 3 notes
GO: 1.1.0 passed

To see whether the switch drops anything, you need traffic flowing while it happens. This script sends 20 requests per second through the proxy and counts what the clients saw, per version:

Python · load.py
"""Send steady traffic through the proxy and count what clients saw, per version."""

import argparse
import ssl
import threading
import time
import urllib.error
import urllib.request
from collections import Counter

parser = argparse.ArgumentParser()
parser.add_argument("--url", default="https://api.localhost:8443/api/notes")
parser.add_argument("--cacert", default="caddy-root.crt")
parser.add_argument("--seconds", type=float, default=30)
parser.add_argument("--rps", type=float, default=20)
args = parser.parse_args()

context = ssl.create_default_context(cafile=args.cacert)
seen: Counter[tuple[str, int]] = Counter()
lock = threading.Lock()


def send(i: int) -> None:
    url = f"{args.url}?limit={i % 5 + 1}"  # limits 1 to 5, in turn
    try:
        with urllib.request.urlopen(url, context=context, timeout=5) as response:
            key = (response.headers.get("X-App-Version", "-"), response.status)
    except urllib.error.HTTPError as error:
        key = (error.headers.get("X-App-Version", "-"), error.code)
    except OSError:  # refused, reset or timed out: the client got nothing
        key = ("-", 0)
    with lock:
        seen[key] += 1


start, threads = time.monotonic(), []
for i in range(int(args.seconds * args.rps)):
    time.sleep(max(0.0, start + i / args.rps - time.monotonic()))
    threads.append(threading.Thread(target=send, args=(i,)))
    threads[-1].start()
for thread in threads:
    thread.join()

for (version, status), count in sorted(seen.items()):
    print(f"version {version:<6} status {status}: {count}")
failed = sum(n for (_, status), n in seen.items() if status == 0 or status >= 500)
print(f"total {sum(seen.values())}, failed {failed}")

Start the load in terminal 2. While it runs, switch in terminal 1 and note the time: it is the start of the verification window.

Terminal 2
python load.py --seconds 30
Terminal 1 (about 10 seconds later)
SWITCHED_AT=$(date -u +%FT%TZ)
./route.sh green
Illustrative output: terminal 1, then terminal 2 when the load finishes (times and counts differ)
2026-10-19T14:30:09Z -> api-green:8000

version 1.0.0  status 200: 209
version 1.1.0  status 200: 391
total 600, failed 0

In this run, all 600 requests succeeded, about a third answered by blue and the rest by green. That shows one switch at 20 requests per second dropping nothing; it is evidence for this setup, not a proof for every load. Caddy documents the mechanism: caddy reload has the same effect as a POST to its /load API, and the API page says configuration changes "incur zero downtime". Now apply the criteria to green's window:

Terminal 1
python verify_release.py --version 1.1.0 --service api-green \
  --direct-url http://127.0.0.1:9002 --since "$SWITCHED_AT"
Illustrative output (the time, counts and p95 differ)
smoke tests against http://127.0.0.1:9002
  ok    /readyz is ready
  ok    version is 1.1.0
  ok    /api/notes?limit=3 gives 3 notes
window from 2026-10-19T14:30:08Z: 391 requests answered by 1.1.0
  ok    requests 391 >= 100
  ok    5xx rate 0.00% <= 1%
  ok    p95 latency 7 ms <= 250 ms
  ok    ERROR log lines 0 <= 0
GO: 1.1.0 passed

1.1.0 is released, and blue still runs 1.0.0, untouched: rolling back would be one ./route.sh blue away. Keep the old slot until the new version has passed its window; two full sets of instances for a while is the main cost of blue-green.

Both versions share the service's state. With a database, every schema change must work for old and new code at once, during the switch and after a rollback. Use expand and contract: first add things (a nullable column, a new table) in a migration both versions tolerate, then release code that uses them, and only in a later release, once rollback to the old code is no longer needed, remove what the old code relied on.

06. Step 5: A canary that fails its check

Version 1.2.0 adds a primary_tag field. Change the last line of list_notes, commit, tag and build:

Python · app/main.py (last line of list_notes)
    return [{**note, "primary_tag": note["tags"][0]} for note in notes[:limit]]
Terminal 1
git commit -qam "Add primary_tag to notes" && git tag -a v1.2.0 -m "Release 1.2.0"
SHA=$(git rev-parse --short HEAD)
docker build -q --build-arg APP_VERSION=1.2.0 --build-arg GIT_SHA=$SHA \
  -t localhost:5000/notes-api:1.2.0 -t localhost:5000/notes-api:sha-$SHA .
docker push -q localhost:5000/notes-api:1.2.0
docker push -q localhost:5000/notes-api:sha-$SHA
export V120=$(docker image inspect localhost:5000/notes-api:1.2.0 \
  --format '{{index .RepoDigests 0}}')
export BLUE_IMAGE=$V120
docker compose up -d --wait api-blue
python verify_release.py --version 1.2.0 --service api-blue \
  --direct-url http://127.0.0.1:9001
Expected output (build and push lines left out)
...
 Container notes-api-api-blue-1 Healthy
smoke tests against http://127.0.0.1:9001
  ok    /readyz is ready
  ok    version is 1.2.0
  ok    /api/notes?limit=3 gives 3 notes
GO: 1.2.0 passed

The smoke tests pass, and blue, now idle, runs 1.2.0. Rather than switching everything, send it 10% of the traffic and keep green as the stable baseline. A canary runs for longer than a switch, because only a tenth of the traffic counts towards its sample:

Terminal 1
CANARY_AT=$(date -u +%FT%TZ)
./route.sh green blue 10
python load.py --seconds 60
python verify_release.py --version 1.2.0 --service api-blue \
  --direct-url http://127.0.0.1:9001 --since "$CANARY_AT"
Illustrative output (times, counts and p95 differ)
2026-10-19T14:30:54Z -> api-green:8000 api-blue:8000 weighted_round_robin 90 10
version 1.1.0  status 200: 1080
version 1.2.0  status 200: 96
version 1.2.0  status 500: 24
total 1200, failed 24
smoke tests against http://127.0.0.1:9001
  ok    /readyz is ready
  ok    version is 1.2.0
  ok    /api/notes?limit=3 gives 3 notes
window from 2026-10-19T14:30:54Z: 120 requests answered by 1.2.0
  ok    requests 120 >= 100
  FAIL  5xx rate 20.00% <= 1%
  ok    p95 latency 7 ms <= 250 ms
  FAIL  ERROR log lines 24 <= 0
NO-GO: 5xx rate 20.00% <= 1%; ERROR log lines 24 <= 0

No-go, on two independent signals. The application log says why:

Terminal 1
docker compose logs api-blue --no-log-prefix | grep -m1 -A3 '^ERROR'
docker compose logs api-blue --no-log-prefix | grep -m1 IndexError
Expected output
ERROR unhandled error on GET /api/notes
Traceback (most recent call last):
  File "/srv/app/main.py", line 45, in tag_version
    response = await call_next(request)
IndexError: list index out of range

Note 5 has no tags, so every request that includes it (limit=5, one request in five) fails on 1.2.0. The smoke tests asked for three notes and never reached it. Clients saw 24 failures out of 1,200, a 2% error rate overall; the same release switched blue-green would have failed 20% of all requests.

07. Step 6: Roll back to the previous digest

Roll back first and investigate afterwards. Send all traffic to green, check that green alone now serves every request without failures, then put the previous good digest back into the blue slot so that both slots are ready for the next release:

Terminal 1
./route.sh green
python load.py --seconds 10
export BLUE_IMAGE=$V110
docker compose up -d --wait api-blue
python verify_release.py --version 1.1.0 --service api-blue \
  --direct-url http://127.0.0.1:9001
cat releases.log
Illustrative output (progress lines left out; times differ)
2026-10-19T14:32:05Z -> api-green:8000
version 1.1.0  status 200: 200
total 200, failed 0
...
 Container notes-api-api-blue-1 Healthy
smoke tests against http://127.0.0.1:9001
  ok    /readyz is ready
  ok    version is 1.1.0
  ok    /api/notes?limit=3 gives 3 notes
GO: 1.1.0 passed
2026-10-19T14:28:44Z -> api-blue:8000
2026-10-19T14:30:09Z -> api-green:8000
2026-10-19T14:30:54Z -> api-green:8000 api-blue:8000 weighted_round_robin 90 10
2026-10-19T14:32:05Z -> api-green:8000

The rollback took one command and a few seconds, because the old version was still running. Note what the 10-second load measured: it ran after route.sh green, so it shows that green alone serves cleanly, not that the rollback switch itself dropped nothing. Step 4 measured a switch under load; to measure this one as well, start load.py in terminal 2 first, as in step 4, and switch while it runs. Redeploying $V110 into blue used the digest you recorded at release time; no rebuild, so you get back exactly what passed its check. The code on main still contains the bug: revert the commit with git revert HEAD, and ship the fix later as 1.2.1 through the same preview, canary and check.

08. The same release on other platforms

Managed platforms give you these mechanisms without the scripts. Kubernetes performs a rolling update by default: it replaces instances a few at a time and moves on only when each new one passes its readiness probe, and kubectl rollout undo returns to the previous version. With settings like these, the rollout keeps three ready instances serving until each replacement passes its readiness probe:

YAML · deployment.yaml (excerpt, illustrative)
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1        # start one extra new instance at a time
      maxUnavailable: 0  # the rollout keeps three ready instances
  template:
    spec:
      containers:
        - name: api
          image: registry.example.com/notes-api@sha256:078e1f7bacaa…
          readinessProbe:
            httpGet: {path: /readyz, port: 8000}
            periodSeconds: 2
          livenessProbe:
            httpGet: {path: /livez, port: 8000}
            periodSeconds: 10

Services such as Google Cloud Run keep every deployment as a revision and can split traffic between revisions by percentage, which gives you canaries and one-command rollback. Static and edge hosts keep every deployment as an immutable snapshot, so a rollback re-points the domain to the previous one almost instantly. Whatever the platform, the parts you supply stay the same: a readiness check that means something, pass criteria written in advance, and the previous artifact kept ready.

09. Troubleshooting

10. Check your understanding

Practice check · 3 questions

Releases, checks and rollbacks

Questions about the releases you just ran.

Q1. 1.2.0 passed all three smoke tests but failed its canary check. What does that tell you?
Q2. A release renames a database column in a single migration. Why is that a problem for blue-green?
Q3. In a quiet hour, the canary window holds 40 requests for the new version, all successful. Using this lab's criteria, what is the verdict?
Practice only: not graded, not saved, not evidence.

11. Apply it: stretch tasks

Finish this skill's practice project on your managed platform:

  1. Turn on preview deployments, open a pull request and note its preview URL.
  2. Commit your pass criteria before releasing: window, minimum requests, 5xx rate, p95 latency and log patterns, using your platform's metrics and logs.
  3. Ship the merged version with the platform's zero-downtime mechanism and run your go/no-go check against its data.
  4. Roll back once, deliberately, and write it up: the command, how long it took and how you verified the result.

Stretch: make verify_release.py also compare a canary with the baseline, for example failing when its p95 is more than 20% above the stable version's, and run load.py during a rollback to measure how many requests, if any, fail while it happens.

12. Review prompt

Without looking back, explain:

  1. How blue-green, canary and rolling releases each move traffic to a new version, and what each costs.
  2. Which criteria the go/no-go script checks, where each number comes from, and why it needs a minimum number of requests.
  3. Why the smoke tests passed for 1.2.0 while the canary failed.
  4. How you rolled back, why it was fast, and what has to be true of database migrations for rollback to stay safe.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check