All sheets / CI/CD & Release
Release Engineering
Deployment strategies, branching, DORA metrics and release gates.
Deployment strategies
| Strategy | How | Rollback | Cost / risk |
|---|---|---|---|
| Recreate | stop old, start new | redeploy | downtime |
| Rolling | replace instances in batches | roll forward/back batch by batch | mixed versions live |
| Blue/green | two full envs, switch traffic | flip back instantly | 2x infra during switch |
| Canary | small % of traffic to new, ramp up | route back to stable | needs good metrics |
| Shadow | mirror traffic, discard responses | n/a | validates perf safely |
| Feature flag | deploy dark, release by toggling | flip the flag | flag debt |
Canary analysis
- Deploy to 1–5% of traffic (or internal users).
- Compare canary vs baseline: error rate, p95/p99 latency, saturation, business KPIs.
- Auto-promote in steps (5 → 25 → 50 → 100%) if within thresholds.
- Auto-rollback on SLO breach.
Tools: Argo Rollouts, Flagger, AWS CodeDeploy (Lambda/ECS linear & canary), LaunchDarkly progressive rollouts.
DORA metrics
| Metric | Measures | Elite |
|---|---|---|
| Deployment frequency | how often you ship to prod | on demand, multiple/day |
| Lead time for changes | commit → running in prod | < 1 day |
| Change failure rate | % deploys causing incidents/rollback | 0–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.4for stabilization; cherry-pick fixes.
Versioning
- SemVer
MAJOR.MINOR.PATCH: breaking / feature / fix. Pre-release1.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.