Blue-green deployment maintains two identical production environments. Traffic routes to 'blue' (current). New version deploys to 'green' (idle). After validation, traffic switches from blue to green instantly (DNS change or load balancer swap). Rollback is instant – switch back to blue. Doubles infrastructure cost during deployment.
Blue-green deployment eliminates deployment downtime and risk by maintaining two complete production environments. The active environment (blue) serves all traffic. The new version deploys to the inactive environment (green), where it undergoes smoke testing and validation against production data. When ready, the router/load balancer switches all traffic from blue to green atomically. If problems emerge, switching back to blue provides instant rollback with zero data loss (assuming the database is shared or migrations are backward-compatible). The cost is doubled infrastructure during the transition period (both environments fully provisioned). Database schema changes require careful coordination – the schema must be compatible with both versions during the switch window. Implementations: AWS Route 53 weighted routing (0% green, then 100% green), Kubernetes service selector update, load balancer target group swap, or DNS CNAME update.
Canary Release
A canary release routes a small percentage of production traffic (1-10%) to the new version while the majority stays on the current version. If the canary shows elevated errors or latency, it is rolled back before affecting most users. Less infrastructure cost than blue-green but requires traffic splitting capability.
Failover
Failover is the automatic transfer of traffic from a failed primary system to a standby replica. Database failover promotes a replica to primary. DNS failover routes to a backup IP. Load balancer failover removes failed backends. Recovery time (RTO) depends on detection speed and promotion mechanism – seconds for load balancer, minutes for database.
High Availability (HA)
High availability is a system design that minimizes downtime by eliminating single points of failure. Measured in 'nines' – 99.9% (8.7h downtime/year), 99.99% (52min/year), 99.999% (5min/year). Requires: redundant components, automatic failover, health monitoring, and tested recovery procedures.