What Is Blue Green Deployment In DevOps?

halfbrain_logo512adminJune 21, 2026
2 lượt xem

What Is Blue Green Deployment In DevOps?

Blue green deployment is a release strategy where two production-like environments exist. One environment serves users, while the other receives the new version. After validation, traffic switches to the new environment.

The goal is to reduce deployment risk and make rollback faster. If the new version fails, traffic can move back to the old environment.

The deeper DevOps lesson is that release strategy is about controlling blast radius, not just copying files to a server.

DevOps Production Playbook

Use this section to understand where the concept fits in a real software delivery system: pipeline stage, production risk, detection signals, rollback, security, and big-company standard.

Release EngineeringRelease
Core Problem

Teams need to release new versions with lower downtime and a fast path back to the previous working version.

Mental Model

Blue green deployment separates deployment from traffic switching. The new version can be prepared before users touch it.

Production Scenario

Blue is serving production users. Green receives version v2. The team runs health checks on green, switches traffic, watches metrics, and switches back if errors rise.

Tooling Context

Load balancer, two environments, health check, DNS or traffic router, deployment version, smoke test, rollback switch.

Command Examples

curl -I https://green.example.com/health; docker ps; kubectl get service; kubectl rollout status deployment/app; nginx -t

Config Example

Traffic model: blue serves users -> green gets new version -> validate green -> switch traffic -> keep blue for rollback

Failure Modes
Detection Signals

Health check failed on green, error rate rises after switch, latency increases, logs show version-specific failures, user complaints begin after traffic shift.

DORA Impact

Blue green deployment can reduce recovery time because rollback is a traffic switch instead of a full rebuild.

Rollback Plan

Switch traffic back to blue, keep green for debugging, confirm metrics return to normal, fix green, retest before another switch.

Security Check

Protect both environments. Ensure secrets are separated but equivalent. Validate security rules. Avoid exposing green publicly without protection.

Big Company Standard

A big company expects pre-switch validation, traffic control, monitoring during release, rollback window, and database migration planning.

Lab Task

Simulate blue and green with two local containers on different ports. Put Nginx in front and switch traffic from one port to another.

Interview Angle

How does blue green deployment reduce risk? What problems can still happen during a blue green release?

Common Mistakes

Deleting the old environment immediately, ignoring database compatibility, switching traffic without health checks, assuming blue and green are identical.

Transferable Principle

Safe release means controlling exposure. This principle applies to web apps, APIs, infrastructure changes, AI services, and content systems.

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *