Zero-downtime deployments
Deployment is a non-event.
Blue-green, canary releases, feature flags. Your team deploys daily without stress — automated, tested, with instant rollback.
Why deployment must not be an event¶
If your team has a “deployment window” and everyone is on standby, the system is telling you something important: the deployment process is broken. Deployment should be routine — like a commit, like code review. Automated, tested, with a clear rollback plan.
Blue-Green Deployment¶
Two identical environments:
- Blue — current production, serving 100% of traffic
- Green — new version, deployed and tested
- Smoke tests on green ✅ → traffic switch (DNS or load balancer)
- Problem? Switch back to blue in seconds
For Kubernetes: Argo Rollouts with automatic health checks. Rollout stops if metrics exceed threshold.
Canary Releases¶
Progressive rollout for large systems:
- New version gets 5% traffic
- Automatic metrics: error rate, latency, business KPIs
- Metrics OK → 25% → 50% → 100%
- Bad metrics → automatic rollback
Entire process: 30-60 minutes. Human intervention only on escalation. Argo Rollouts or Flagger for Kubernetes.
Feature Flags¶
Separating deploy from release:
- Code in production, feature disabled — deploy without risk
- Progressive enablement — internal → beta → 10% → 100%
- A/B testing — variant A vs. B, metrics decide
- Kill switch — instant disable of problematic feature
- Targeting — feature only for specific users/segments
Tools: LaunchDarkly, Unleash, custom solutions. CI/CD integration — feature flag automatically created when merging PR with feature flag annotation.
Database Migrations¶
The riskiest part of deployment. Rules:
Expand-Contract Pattern: 1. Expand — Add new column, keep the old one 2. Migrate — Copy/transform data 3. Switch — Application reads from new column 4. Contract — Remove old column
No ALTER TABLE with locks. No DROP COLUMN during deployment. Every migration is rollbackable.
CI/CD Pipeline¶
┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────┐ ┌──────────┐
│ Commit │──▶│ Build │──▶│ Test │──▶│ Stage │──▶│ Prod │
│ │ │ + Lint │ │ Unit │ │ E2E │ │ Canary │
│ │ │ + SAST │ │ Integ │ │ Smoke │ │ → Full │
└─────────┘ └──────────┘ └──────────┘ └─────────┘ └──────────┘
│
Auto rollback
on threshold
Commit → production in < 15 minutes. Automated. With quality gates at every step.
Časté otázky
Expand-contract pattern. We add a new column (expand), migrate data, remove the old one (contract). No breaking changes, no table locks.
Yes. Blue-green deployment works for both monoliths and microservices. Feature flags separate deploy from release regardless of architecture.
Basic pipeline (build → test → deploy): 2-4 weeks. Full progressive delivery stack (canary, feature flags, automated rollback): 4-8 weeks.