Cloud & infrastructureblue/green deploymentblue-green releasered-black deployment

Blue-green deployment

Definition

A blue-green deployment keeps two complete environments: blue serves production while green is deployed and tested, then a router or load balancer switches all traffic to green, and switching back is the rollback.

In practice

The appeal is a clean cut-over and an instant rollback: the old environment stays warm until you are confident. You can run smoke tests against green with production configuration before any user sees it, and the switch is a single routing change.

It needs roughly double capacity during the release and exposes every user the moment you switch, so it limits rollback time, not blast radius. Shared state is the usual trap: if both environments write to one database, schema changes must work with both versions. Caches and connection pools in green also start cold.

Example

Green runs 12 pods of v2 next to 12 pods of v1; a smoke test passes, the Service selector flips to version: v2, and error rates jump, so the selector flips back within 30 seconds.