Choosing a deployment strategy is a trade-off between release risk, rollback speed, infrastructure capacity, database compatibility, traffic control, and operational effort. This guide compares rolling, blue-green, canary, recreate, and feature-flag releases, then gives you a repeatable way to select a strategy, estimate its operational cost, prepare a pipeline, and run a rollback.
Overview
No deployment strategy is safest in every situation. The right choice depends on what can fail, how quickly failure must be detected, whether two application versions can run together, and how much duplicate capacity your platform can support.
Use the following comparison as a starting point. The ratings are relative planning guidance, not universal measurements. A well-instrumented rolling release may be safer than a poorly observed canary, while a blue-green release may be impractical when the database cannot support compatibility between versions.
| Strategy | Rollback speed | Infrastructure cost | Database compatibility | Traffic control | Observability need | Operational complexity |
|---|---|---|---|---|---|---|
| Rolling | Medium | Low to medium | Usually requires backward compatibility | Limited to moderate | Medium | Medium |
| Blue-green | Fast when the old environment remains healthy | High during overlap | Requires compatible shared services and data changes | High at the environment boundary | Medium to high | Medium |
| Canary | Fast if traffic can be shifted back | Medium to high | Requires compatible versions during the test | High | High | High |
| Recreate | Slow or service-interrupting | Low | Simple only when downtime and version changes are acceptable | Low | Low to medium | Low |
| Feature flag | Fast for application behavior | Usually low infrastructure overhead | Still requires safe code and schema compatibility | High at the user or request level | High | Medium to high |
Rolling releases
A rolling deployment replaces instances or pods in batches. The service remains available while old and new versions coexist. Set a small batch size for higher-risk changes, define readiness checks that test real serving conditions, and pause between batches long enough to observe errors, latency, saturation, and business signals. Rolling releases are a practical default when capacity is constrained and the application supports mixed-version operation.
Blue-green releases
Blue-green deployment runs two environments: the currently serving environment and the candidate environment. After validation, traffic moves from one to the other. This creates a clear rollback path, but the overlap consumes additional capacity and does not remove data risk. A traffic switch cannot undo a destructive migration or an incompatible write.
Canary releases
A canary sends a controlled portion of traffic to the candidate version before broader rollout. The percentage can be based on requests, users, regions, tenants, or another routing rule. Canary delivery is valuable for changes whose behavior depends on production traffic, but it requires reliable metrics, representative exposure, and an automated or well-rehearsed way to stop promotion.
Recreate releases
Recreate deployment stops the old version before starting the new one. It is straightforward and avoids mixed-version behavior, but it introduces downtime or a service interruption. Use it only when the interruption is acceptable, the maintenance window is explicit, or the workload has a separate availability design.
Feature-flag releases
Feature flags separate code deployment from user-visible activation. A team can deploy dormant code, enable it for a small cohort, and disable the behavior without rebuilding the artifact. Flags do not replace deployment safety: schema changes, memory leaks, startup failures, and other defects still require a deployment rollback. Every flag should have an owner, an expiry or review date, and a defined fallback behavior.
How to estimate
Estimate a strategy by scoring the release against six questions. Use a simple scale from 1 to 5, where 1 is favorable and 5 indicates more exposure, cost, or effort. Record the reasoning rather than treating the total as an objective answer.
- Rollback urgency: How quickly must service return to the previous behavior if the release fails?
- Capacity overhead: Can the platform run old and new capacity together during validation?
- Database and API compatibility: Can both versions safely read and write the same data and call the same dependencies?
- Traffic control: Do you need exposure by percentage, tenant, region, user group, or request type?
- Observability maturity: Can you detect regressions using logs, traces, metrics, alerts, and business checks?
- Operator effort: Can the on-call team execute the rollout and rollback under pressure?
A useful planning score is:
Strategy score = risk weight × rollback exposure + cost weight × capacity overhead + complexity weight × operator effort.
The weights should reflect the service. For a payment path, rollback exposure may matter more than compute overhead. For an internal batch worker, a recreate release may be acceptable even if it would be unsuitable for a public API. If a strategy scores well but fails the database compatibility check, reject it rather than averaging away that constraint.
A practical decision tree
- If downtime is acceptable and mixed-version operation is unsafe, consider recreate.
- If you need a quick environment-level switch and can fund duplicate capacity, consider blue-green.
- If you need gradual exposure and have strong telemetry, consider canary.
- If the service supports backward-compatible versions and capacity is limited, consider rolling.
- If the change is behavior-specific and must be released separately from activation, add a feature flag to one of the deployment approaches.
These options can be combined. For example, a team may use a rolling deployment to install the binary, a feature flag to control the new path, and a canary policy to increase exposure.
Inputs and assumptions
Before choosing a release strategy, write down the assumptions that affect the result. This turns a preference into a reviewable delivery decision.
- Service objective: Define the availability target, acceptable interruption, and maximum tolerable error increase.
- Capacity: Record current headroom, startup time, replica limits, and whether duplicate environments fit within the available budget.
- Compatibility: Check API contracts, queue formats, event schemas, database reads and writes, caches, and background jobs.
- Signals: Choose thresholds for error rate, latency, saturation, restarts, queue depth, and relevant business outcomes. Keep thresholds tied to a baseline where possible.
- Routing: Specify how traffic moves and who can stop promotion. Avoid relying on an untested manual switch.
- Artifact identity: Promote an immutable build reference, preferably a digest or equivalent version identifier, rather than rebuilding during deployment.
- Rollback boundary: Decide whether rollback means restoring traffic, redeploying the prior artifact, disabling a flag, or applying a forward fix.
Provider-neutral CI/CD stages
A portable pipeline can be organized as follows:
validate -> build -> test -> scan -> publish immutable artifact
-> deploy candidate -> smoke test -> observe
-> promote in steps -> verify -> finalize
-> rollback if a stop condition is met
Keep promotion separate from artifact creation. The same tested artifact should move through environments, with approvals or automated gates appropriate to the risk. In Kubernetes-based platforms, readiness checks, rollout status, service routing, and termination behavior should be tested together rather than configured independently. For GitOps workflows, make the desired version and promotion state visible in version control, and document who reverts the change during an incident.
Worked examples
Example 1: A stateless API with limited spare capacity
The API has backward-compatible endpoints, instances start quickly, and the team has request metrics and structured logs. Duplicate environments would be expensive, but a small amount of spare capacity is available. A rolling release with conservative batches is a reasonable choice. Add an automated pause when error rate or latency exceeds the agreed threshold. If the new version is behaviorally risky, use a feature flag so the binary can be deployed before activation.
Estimated planning profile: low capacity overhead, medium rollback speed, medium observability need, and medium operational complexity. The critical assumption is that old and new instances can safely coexist.
Example 2: A high-risk customer-facing change
The team can run a second environment and route traffic by tenant. The change affects a request path with clear latency and error indicators. A canary or blue-green approach is preferable to an all-at-once release. Start with an internal or low-risk cohort, compare candidate and baseline signals, then expand only after each gate passes. Keep the old environment available until the rollback window closes.
Estimated planning profile: high capacity overhead, high traffic control, high observability need, and high operator discipline. The rollback plan should restore routing first, then investigate the candidate separately.
Example 3: A schema change with incompatible writes
None of the traffic strategies solves an incompatible database transition by itself. First redesign the migration as an expand-and-contract sequence: introduce structures that both versions can use, deploy compatible application code, migrate or backfill data, switch reads or writes, and remove obsolete structures only after the old version is no longer needed. If that sequence is not possible, schedule an explicit interruption and use a recreate-style release with a tested restore path.
Rollback runbook template
- Declare: Name the incident lead and record the release identifier, start time, affected service, and observed symptoms.
- Stop promotion: Freeze further batches, traffic increases, or feature-flag activation.
- Protect users: Shift traffic to the stable environment, disable the feature, or scale a safe version according to the chosen strategy.
- Confirm: Check health, error rate, latency, saturation, logs, traces, and the relevant business signal.
- Contain data risk: Identify writes made by the candidate and determine whether reconciliation or a forward fix is required.
- Communicate: Update stakeholders with what changed, what was rolled back, and what remains uncertain.
- Close carefully: Preserve evidence, assign follow-up work, and do not delete the candidate until investigation is complete.
When to recalculate
Revisit the deployment decision whenever the inputs change, not only after a failed release. Recalculate after a change in traffic shape, service criticality, infrastructure capacity, database design, routing capability, observability coverage, or on-call ownership. A strategy that was appropriate for a small service may become costly or unsafe as replicas, regions, tenants, or dependencies increase.
Review the decision before a high-risk migration, a major dependency update, a cluster or platform upgrade, or a release that changes authentication, billing, data retention, or public API behavior. Also review it after an incident: compare the expected rollback time with the actual time, identify which signal failed to detect the issue, and update the pipeline gate or runbook.
For a practical next step, choose one upcoming release and complete the six-factor scorecard. Validate mixed-version behavior in a representative environment, exercise the rollback path with the exact artifact that will be promoted, and record the stop conditions in the pipeline. Then revisit the score after the release using observed capacity, detection, and recovery data. This keeps continuous delivery grounded in the operating reality of the service rather than in a permanent preference for one deployment pattern.