Blue-green, canary, and zero-downtime—deploy with confidence and roll back when needed.
How you deploy affects risk and recovery. Here’s a concise guide to common strategies.
Deployment and release
Strategies
Recreate — Stop old version; deploy new. Simple but causes downtime. Acceptable for many internal or low-traffic apps.
Rolling — Replace instances gradually. No second environment; some old and new run together. Watch for compatibility (e.g. DB schema).
Blue-green — Two identical environments; switch traffic at once. Fast rollback (switch back). Requires double resources during switch.
Canary — Send a small share of traffic to the new version. Increase if metrics are good; roll back if not. Reduces blast radius.
Feature flags — Deploy code behind a flag; turn on for users gradually. Decouples deploy from release. Use with any of the above.
Strategy usage (teams):
Primary deployment strategy
Frontend vs backend
Frontend — Static/SPA: deploy to CDN; invalidate cache. Next.js: Vercel/Netlify handle previews and rollbacks. Version by URL or cache busting for assets.
Backend — Use rolling or blue-green. Run DB migrations in a backward-compatible way (expand then contract). Health checks and readiness probes before traffic.
Deployment strategies in practice:
Takeaway
Match the strategy to risk and resources. Use blue-green or canary when downtime or bad releases are costly. Use feature flags to separate deploy from release. Always have a rollback plan.