cs.oldnet

All sheets / CI/CD & Release

Release Engineering

Deployment strategies, branching, DORA metrics and release gates.

Deployment strategies

StrategyHowRollbackCost / risk
Recreatestop old, start newredeploydowntime
Rollingreplace instances in batchesroll forward/back batch by batchmixed versions live
Blue/greentwo full envs, switch trafficflip back instantly2x infra during switch
Canarysmall % of traffic to new, ramp uproute back to stableneeds good metrics
Shadowmirror traffic, discard responsesn/avalidates perf safely
Feature flagdeploy dark, release by togglingflip the flagflag debt

Canary analysis

  1. Deploy to 1–5% of traffic (or internal users).
  2. Compare canary vs baseline: error rate, p95/p99 latency, saturation, business KPIs.
  3. Auto-promote in steps (5 → 25 → 50 → 100%) if within thresholds.
  4. Auto-rollback on SLO breach.

Tools: Argo Rollouts, Flagger, AWS CodeDeploy (Lambda/ECS linear & canary), LaunchDarkly progressive rollouts.

DORA metrics

MetricMeasuresElite
Deployment frequencyhow often you ship to prodon demand, multiple/day
Lead time for changescommit → running in prod< 1 day
Change failure rate% deploys causing incidents/rollback0–15%
Time to restore (MTTR)incident → recovered< 1 hour

Throughput = first two; stability = last two. Small batches + automation improve both.

Branching models

  • Trunk-based: short-lived branches (< 1–2 days) merged to main; incomplete work hidden behind flags. Enables CI/CD.
  • GitFlow: develop, feature/*, release/*, hotfix/*. Heavy; suits versioned/boxed software.
  • GitHub flow: branch → PR → merge to main → deploy.
  • Release branches: cut release/1.4 for stabilization; cherry-pick fixes.

Versioning

  • SemVer MAJOR.MINOR.PATCH: breaking / feature / fix. Pre-release 1.2.0-rc.1.
  • Conventional commits (feat:, fix:, feat!:) → automated version bumps & changelog (semantic-release, release-please).
  • Tag immutable artifacts with version + commit SHA.

Release gates & quality

  • PR checks: lint, unit, type-check, SAST, dependency scan, coverage threshold.
  • Build verification tests (BVT) / smoke tests on every build.
  • Integration + E2E on staging; contract tests between services.
  • Manual approval for prod (environment protection) where required.
  • Post-deploy: synthetic checks, error budget watch, automated rollback.

Rollback vs roll forward

  • Rollback: redeploy last known good artifact; must be fast and rehearsed.
  • Roll forward: ship a fix; fine when the fix is small and the pipeline is fast.
  • DB changes break naive rollback → use expand/contract: add new column → write both → backfill → read new → drop old (separate releases).

Zero-downtime checklist

  • Health checks (readiness vs liveness) and connection draining.
  • Graceful shutdown on SIGTERM.
  • Backward-compatible APIs and schema changes.
  • Idempotent migrations run before code that needs them.
  • Version mixed fleets: old and new code run together during rollout.

Multi-platform builds

  • Build matrix per OS/arch (Windows, macOS, Linux; x64/arm64).
  • Code signing & notarization (macOS), Authenticode (Windows).
  • Reproducible builds; pinned toolchains; artifact checksums.
  • Triage regressions by bisecting builds (git bisect) and quarantining flaky tests.

Interview talking points

  • "Moved weekly → daily deploys": trunk-based + flags + automated gates + fast rollback.
  • "Zero-downtime": blue/green or rolling with health checks, expand/contract migrations.
  • "Lowered CFR/MTTR": canaries, observability-driven auto-rollback, kill switches.