Serksa
All Concepts
DevOps & Infrastructure

Blue-Green Deployment

1

What is it?

<strong>Blue-green deployment</strong> is running two identical production environments (blue and green). You deploy to the inactive one, test it, then switch traffic over. Enables zero-downtime deployments and instant rollback.

2

Think of it like...

The Stage Performance Analogy

Blue-green is like having two stages. Audience watches Stage A while you rehearse the new show on Stage B. When ready, instantly switch audience to Stage B.

🎭

Stage A (Blue)

Current show

🎪

Stage B (Green)

Rehearse new show

👥

Audience (Users)

Switch stages instantly

3

Visual Flow

🔵Blue (Live)

Serving Traffic

🟢Green (Staging)

Deploy New Version

🔄Switch

Instant Cutover

4

Where you see it

1

Blue is live

All traffic goes to blue environment

2

Deploy to green

Deploy new version to green (inactive)

3

Test green

Run smoke tests, verify everything works

4

Switch traffic

Load balancer routes traffic to green

5

Rollback if needed

Switch back to blue instantly if issues arise

5

Common Mistake

Wrong

"Blue-green requires double the infrastructure cost"

Correct

<strong>Only during deployment</strong>. After switching, you can shut down the old environment or keep it for instant rollback. Cost is temporary, safety is permanent.

💡 Real-World Example

Deploying a critical update:

1

Blue environment serves 1M users

2

Deploy new version to green environment

3

Test green with internal traffic

4

Switch 100% traffic to green → zero downtime!

5

If issues: Switch back to blue in 5 seconds