CV0-004 · Deployment · Updated July 26, 2026
Blue-Green Deployment: Instant Cutover, Shared Databases, and What It Costs
Blue-green deployment is a release strategy that maintains two complete, identical production environments — conventionally called blue (the version currently serving users) and green (the new version being staged). All live traffic goes to exactly one environment at a time. After the green environment is fully deployed, tested, and validated, a router or load balancer switches 100% of user traffic from blue to green at a single point in time. Because the old environment stays intact, rolling back is as simple as flipping traffic back.
What it is
The defining characteristic of blue-green is the pair of full production environments. Both are sized to handle the entire production load, and both exist simultaneously during a release window. At any given moment only one of them — the “live” color — receives user requests. The other is idle: either it holds the outgoing version (kept warm as an instant rollback target) or it holds the incoming version being prepared for cutover.
The cutover itself is a traffic-routing change, not a software install. Nothing is copied onto running servers and no processes restart in front of users. A load balancer target group swap, a DNS weight change, or a service-mesh routing rule sends every subsequent request to green. From the user’s perspective the new version appears all at once, with no maintenance window — this is why blue-green is the textbook answer whenever a requirement specifies true zero-downtime releases with a near-instantaneous switch.
How a blue-green release actually runs
- Provision or refresh green. The green environment is built to match blue exactly: same instance types, same configuration, same capacity. In cloud environments this is usually automated with infrastructure-as-code templates so the two stacks cannot drift.
- Deploy and validate green in isolation. The new application version is installed on green while blue continues serving all users. This is the critical gate: green must pass its full validation suite — health checks, smoke tests, integration tests, performance verification — before it receives any live production traffic. Untested code never touches a real user.
- Cut over. Routing flips, and green becomes the live environment. The switch affects all users simultaneously.
- Hold blue as the rollback target. The old environment is kept running (typically for hours or days). If a critical defect surfaces in green, traffic flips back to blue in seconds — no redeploy, no rebuild, no data restore.
- Decommission or recycle blue. Once green is trusted, blue is torn down to stop paying for it, or retained as the staging target for the next release (the colors swap roles each cycle).
The shared-database problem
Compute is easy to duplicate; state is not. In most real blue-green setups, both environments point at the same database — running two copies of production data and keeping them synchronized during a cutover is far harder than running two copies of an application tier.
A shared database imposes one hard rule: every schema change must be backward compatible with the old application version for the entire transition. While blue is live (and again if you roll back), the old code must still work against the current schema. That means additive, non-breaking migrations: add a new nullable column instead of renaming one, create a new table instead of restructuring an existing one, and never drop a column the blue version still reads. Destructive changes are deferred until blue is fully retired. Teams often formalize this as an “expand and contract” pattern — expand the schema before the release, contract (clean up) only after the old version is gone.
If a release requires a breaking schema change, blue-green’s headline benefit — instant rollback — quietly disappears, because flipping traffic back to blue would point old code at a schema it can’t use.
What blue-green costs, and where it fails
Cost. The primary financial drawback is straightforward: during every release window you run two full production environments, so infrastructure spend for the application tier roughly doubles compared to a strategy like rolling deployment, which upgrades the existing fleet in batches and never needs a duplicate stack. Cloud elasticity softens this — green can be provisioned hours before cutover and destroyed shortly after — but the peak requirement is still 2x capacity, and organizations that keep blue warm for days as a rollback target pay for it the whole time.
All-at-once blast radius. The cutover is binary: one moment 0% of users are on the new version, the next moment 100% are. Any defect that slipped past pre-cutover validation — a subtle logic bug, an issue that only appears under real production traffic patterns or real data — hits the entire user base simultaneously. There is no small pilot group absorbing the damage first. A bug affecting even a modest percentage of transactions becomes a production-wide incident the instant traffic flips. This is the core limitation that motivates canary deployment, which trades the instant cutover for a monitored, gradual exposure that catches such bugs while only a sliver of traffic is affected.
Session and in-flight work. Long-lived connections and in-progress sessions on blue are disrupted or must be drained at cutover, which is why blue-green pairs naturally with stateless application tiers and externalized session storage.
Blue-green vs rolling: the core trade
| Factor | Blue-green | Rolling |
|---|---|---|
| Extra infrastructure | Full duplicate environment (≈2x during release) | None or one small surge batch |
| Cutover speed | Near-instant, single switch | Gradual, batch by batch |
| Rollback | Seconds — route traffic back to old environment | Slow — re-deploy old version through the batches |
| Versions in production | One at a time (per environment) | Old and new coexist mid-rollout |
| Failure exposure | 100% of users at once post-cutover | Only the updated batches |
For the full four-way comparison — including in-place and the cost and rollback ladders — see choosing a deployment strategy.
How the CV0-004 exam tests this
- Identify-the-strategy stems: a description of “two identical production environments, all traffic shifted from one to the other at once after validation” — the answer is blue-green, and distractors are rolling, canary, and in-place.
- Requirements matching: a company needs zero downtime, instant rollback to the prior version, and has budget for duplicate infrastructure — the combination of those three clues (especially the budget clue) points to blue-green over canary or rolling.
- Drawback questions: which cost consideration argues against blue-green — expect “doubled infrastructure during the release” as the answer, contrasted with rolling’s reuse of existing servers.
- Failure-analysis scenarios: a bug appears right after full cutover and affects a slice of all production traffic — the exam wants you to name the limitation being illustrated: the all-at-once switch exposes every user simultaneously, with no gradual canary-style containment.
- Database stems: both colors share one database — the required property is backward-compatible schema changes so the old version keeps working during (and after a rollback of) the transition.
Deployment strategies are a core objective in the Deployment domain of the full CV0-004 study guide — and one of the most heavily drilled topics in the Cloud+ practice exam bank.
Quick reference
- Two identical full production environments; only one serves live traffic at a time.
- Cutover is a routing flip — near-instant, zero downtime, all users switch together.
- Green must pass complete validation before receiving any production traffic.
- Rollback = flip traffic back to the still-running old environment, in seconds.
- Primary drawback: paying for double infrastructure during the release window.
- Shared database demands backward-compatible (additive, non-breaking) schema changes.
- Bugs that survive validation hit 100% of users at once — no small pilot group.
- Choose it when the requirement says instant cutover + instant rollback and budget allows 2x.