# Blue-Green Deployment

> Run two full copies, then move all traffic from the old to the new.

**Field:** Software Development  
**Category:** DevOps & Cloud  
**Also known as:** Blue/Green Deployment, Blue Green Deploy, Red-Black Deployment

## Think of it like

Think of it like two stages side by side. You set up the next act on the dark stage, then switch the lights over.

## Definition

Blue-green deployment keeps two full copies of the live setup. They are called blue and green. One serves users while the other sits idle. You deploy the new version to the idle one and test it there. Then you switch all traffic over at once. If something is wrong, you switch back in seconds, because the old copy is still running.

## Example

Lucy's shop runs on blue. She deploys version 3 to green, checks it, and flips the switch. A bug shows up, so she flips back to blue a minute later.

## Why it matters

Going back is instant, since the old version never stopped. It is one of the safest ways to ship.

## Common mistake

Forgetting the database. Both copies often share one, so a change to its tables must work with both versions.

## Three principles

- **Two full copies.** One live, one idle.
- **Switch all at once.** Every user moves together.
- **Instant way back.** The old copy still runs.

## Related terms

- [Deployment Strategy](https://learn.benibix.com/term/development/deployment-strategy)
- [Canary Release](https://learn.benibix.com/term/development/canary-release)
- [Rollback](https://learn.benibix.com/term/development/rollback)
- [Zero-Downtime Deployment](https://learn.benibix.com/term/development/zero-downtime-deployment)

## Told apart from

- [Blue-Green Deployment vs Canary Release](https://learn.benibix.com/compare/blue-green-vs-canary): Blue-green deployment and a canary release both make a new version safer to ship, but they move users in different ways. Blue-green moves every user at once, from one full copy to the other. It can switch back in seconds. A canary moves a few users first, then more. Blue-green is quick; a canary keeps a bug small.
- [Rolling Update vs Blue-Green Deployment](https://learn.benibix.com/compare/rolling-update-vs-blue-green-deployment): People think a rolling update is the same as blue-green, since both keep the site up, and it is not. A rolling update swaps the servers a few at a time. For a while, old and new run side by side. Blue-green builds a whole second copy and moves every user at once. It costs more, but going back takes seconds.

---

Source: https://learn.benibix.com/term/development/blue-green-deployment
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
