Blue-Green deployment — strategy с двумя identical production environments: Blue (current live) и Green (new version). Load balancer switches traffic 100% на Green для deploy, revert мгновенно если что-то сломалось. Plus: zero downtime, instant rollback. Minus: double infrastructure cost во время deploy, DB schema migrations сложны (обе versions должны работать на одной DB).
Ниже: подробности, пример, смежные термины, FAQ.
# nginx load balancer switch
upstream backend {
server 10.0.0.1:8080; # Blue
# server 10.0.0.2:8080; # Green (commented until deploy)
}
# After deploy: swap comments, nginx -s reloadRolling: update pods одна по одной (K8s default). Blue-green: 2 full envs + swap. Blue-green safer для stateful, rolling простой для stateless.
Во время deploy — yes (часы). Нет необходимости держать постоянно — create Green at deploy time, destroy after success.
Schema должна быть backwards-compatible (не drop columns, не rename). Forward-compatible: add nullable columns, defaults.