Delivery, deployment and rollout strategies: how each one fails
Differentiate continuous delivery from deployment, contrast recreate, rolling update, blue-green, and canary rollout strategies, and analyze real-world production failure modes.
Contentsand lesson path
On this page
- Why it matters
- Delivery, deployment and release: three different steps
- Core Rollout Strategies: Recreate, Rolling, Blue-Green, and Canary
- Real-World Production Failure Modes and Selection Heuristics
- Check your understanding
- Apply it
- Review prompt
Lessons of CD Strategies
- Delivery, deployment and rollout strategies: how each one fails Concept · 25 min
- Lab: a staged pipeline with approval and smoke tests Lab · 30 min
- Lab: a TLS-terminating reverse proxy in front of the service Lab · 30 min
- Lab: blue-green cutover and rollback behind the proxy Lab · 25 min
- Schema changes, feature flags, GitOps, traffic splitting and service meshes Concept · 30 min
- Check: choose and defend a release plan Knowledge check · 10 questions
What you will learn
- Compare recreate, rolling, blue-green and canary releases by risk, cost, speed and rollback time, and choose one for a given service.
- Build a delivery pipeline that promotes one artifact from staging to production with environment protection, approval and smoke tests.
Prerequisites: Cloud Basics, Continuous Integration
01. Why it matters
Most outages start with a change, and many of them come from the way the change reached production rather than from the code itself: every server was replaced at once, two versions disagreed about the database, or a rollback took as long as the rollout. A rollout strategy decides how many users meet a new version first, how long old and new versions run side by side, and how quickly you can go back. This lesson defines the words teams use for these steps and compares the four common strategies, so you can pick one that fits a given service.
02. Delivery, deployment and release: three different steps
People often use "continuous delivery", "continuous deployment" and "release" as if they meant the same thing. They do not, and mixing them up leads to plans in which nobody knows who decides when users see a change. The three terms mean:
-
Continuous Delivery (CD): An engineering discipline where every code change committed to the mainline branch is automatically built, tested, packaged into an immutable artifact, and staged in a production-ready state. In Continuous Delivery, the actual push to production is an explicit, human-authorized business decision (such as an approval click in an operations dashboard).
-
Continuous Deployment: An extension of Continuous Delivery with no human gate before production. If all automated validation gates (unit tests, integration suites, container security scans, and infrastructure lints) pass, the pipeline automatically deploys the artifact directly to live production servers without manual intervention.
-
Deployment vs. Release: Deployment is the technical action of installing and running a specific artifact version on server infrastructure. Release is the business action of exposing the new behavior or feature to end users. Decoupling deployment from release—achieved through feature flags, internal dark launching, or weighted routing—lets engineering teams deploy code at any time without exposing it to users straight away.
The difference matters for the rest of this lesson: once deploying and releasing are separate steps, a rollout strategy is a choice about how the new version reaches users, not only about how it reaches servers.
03. Core Rollout Strategies: Recreate, Rolling, Blue-Green, and Canary
When transitioning workloads from an existing version (v1) to a newly built version (v2), engineering teams evaluate four foundational deployment strategies:
-
Recreate (Downtime Strategy): Terminates all active instances of
v1before launching instances ofv2. During the transition window, the service is completely offline, returning HTTP 503 or dropped connections to users. While unacceptable for customer-facing web APIs, Recreate is the ideal and often required strategy for singleton background batch processors or stateful workloads that cannot tolerate two disparate versions executing concurrently against un-migrated file stores or database tables. -
Rolling Update (Incremental In-Place Strategy): Gradually replaces instances of
v1withv2one node or batch at a time (e.g. 25% max surge, 0% max unavailable). The service stays online, but the rollout needs either a little extra capacity (maxSurge, here up to 25% more pods while new ones start) or temporarily fewer serving replicas (maxUnavailable); you choose which with those two settings. However, for as long as the rollout lasts (minutes for a small service, longer for a large fleet), bothv1andv2run side by side, serving requests at the same time. Ifv2introduces a backward-incompatible schema change or API contract change, thev1instances that are still running can start failing. -
Blue-Green Deployment (Parallel Environment Strategy): Runs a second, identical copy of the production environment (Green) with
v2next to the live one (Blue) withv1. Green is a full production environment that has no users yet; it is not a staging environment, which is a separate copy used only for testing and is often smaller. Once Green passes thorough smoke testing, the ingress router or reverse proxy switches new requests from Blue to Green, typically within seconds. The switch is not atomic for everything in flight: requests already running finish on Blue, long-lived connections (keep-alive, WebSockets) stay on Blue until they close or are cut, and DNS-based switching takes as long as clients cache the old record (the TTL). Switching back is equally fast, provided Blue still works with any schema or data changes Green has made in the meantime. The primary drawback is cost: running two full production environments simultaneously requires double the compute capacity during releases. -
Canary Release (Statistical Traffic-Splitting Strategy): Deploys
v2to a small subset of infrastructure and routes a minor fraction of live production traffic (e.g. 2% or 5%) to it, while the rest continues to hit thev1baseline. Automated metrics collectors monitor error rates, latency percentiles, and business KPIs. If metrics remain healthy over a statistical evaluation window, traffic incrementally shifts to 25%, 50%, and 100%. If anomalies occur, traffic shifts back to the baseline, and only the small canary share of users was affected.
apiVersion: apps/v1
kind: Deployment
metadata:
name: payment-api
spec:
replicas: 8
selector:
matchLabels:
app: payment-api
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25% # Spin up at most 2 new Pods above replica count
maxUnavailable: 0 # Keep 8 ready Pods while the rollout runs
template:
metadata:
labels:
app: payment-api
spec:
containers:
- name: app
image: ghcr.io/org/payment-api:v2.4.0
ports:
- containerPort: 808004. Real-World Production Failure Modes and Selection Heuristics
Choosing a rollout strategy that does not fit the workload is a common cause of production outages. Teams look at how each strategy fails before they choose one:
-
Two versions against one database: In rolling, blue-green, and canary deployments, old and new versions run at the same time against the same database, or can be switched back and forth. If an engineer ships code that alters a database column type or deletes a field without a multi-phase migration, the old version can fail when it reads data written by the new one. Teams need backward-compatible "expand and contract" schema changes before they rely on rollouts without downtime.
-
Too little traffic for a canary: A canary release depends on statistical sample size. If an internal corporate service receives only 25 HTTP requests per hour, routing 5% of traffic to a canary sends approximately 1 request every 48 minutes. An error rate metric cannot reach statistical significance on such low volume; a single transient network timeout swings the canary error rate from 0% to 100%, causing frequent false-positive rollbacks. Low-traffic services should rely on blue-green deployments validated with synthetic traffic generator scripts rather than statistical canaries.
-
Sessions lost in a switch: If an application keeps session data in the memory of one server process rather than in a shared store such as Redis or Memcached, the load balancer must send each user back to the same instance (sticky sessions). A rolling update or a blue-green switch then replaces or bypasses that instance and drops its sessions: users lose their shopping carts, have to log in again, or see a half-finished transaction fail.
So before you choose a strategy, check four things: how much traffic the service gets, whether it keeps state in memory, whether the release changes the database, and how fast you must be able to roll back.
05. Check your understanding
06. Apply it
Choose a rollout strategy for three services, and write down how each choice could still fail. This takes about 20 minutes and needs only a text editor. The services are:
- A nightly invoice job that runs as one process, and whose new release renames a database column.
- A public, stateless search API with about 3,000 requests per minute and no schema change.
- An internal admin tool with about 20 requests per hour that keeps login sessions in the memory of one process.
- For each service, name the strategy you would use (recreate, rolling update, blue-green or canary) and give one sentence of reasons based on the four checks at the end of this lesson: traffic, state kept in memory, database change and rollback speed.
- For the service that gets a rolling update, copy the
payment-apimanifest from this lesson, setreplicas: 6, and choosemaxSurgeandmaxUnavailablefor a cluster that has room for only one extra Pod. Write how many Pods can serve traffic at the lowest point of the rollout. - For each service, write one way your choice could still fail and what you would check before the release (for example "the old version can still read the table after the migration").
Produce: a short text file with the three choices, the edited YAML and the three failure notes. If no strategy fits a service as it is today, write what you would change first, such as moving the sessions to a shared store.
07. Review prompt
Contrast Continuous Delivery with Continuous Deployment and explain how decoupling deployment from release changes team delivery velocity. Compare recreate, rolling update, blue-green, and canary rollout strategies across infrastructure cost, downtime, and operational complexity, and describe why statistical canary analysis fails on low-volume services.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
10 questions · about 8 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.