_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

Blue-Green Deployment — Zero-Downtime Releases

08. 09. 2016 1 min read CORE SYSTEMSai

Deploying a new version used to mean a maintenance window, notifying users, and hoping for the best. Blue-green deployment eliminates downtime: two identical environments, a load-balancer switch, and instant rollback. No more late-night deployments.

The Principle

Two environments: Blue (current production) and Green (new version). Deploy to Green, test it, switch the router/LB to Green. Blue remains available as an instant rollback. Problem? Switch back to Blue in seconds.

Implementation with Nginx

# Switching from blue to green
upstream app {
    server green-server:8080;
    # server blue-server:8080;  # commented out
}

# nginx -s reload

Database Migrations

The biggest challenge. Both versions must work with the same database. Rules: add columns (do not remove them), make backward-compatible changes, use Flyway/Liquibase for versioned migrations. Destructive changes only after a successful switch.

With Docker and Swarm

Docker Swarm rolling update is effectively blue-green at the container level. docker service update --image myapp:2.0 gradually replaces instances.

Zero Downtime is Achievable

Blue-green deployment requires investment in infrastructure and discipline around database migrations. But eliminating downtime and having instant rollback is worth it.

awsdevopsec2s3
Share:

CORE SYSTEMS

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.

Need help with implementation?

Our experts can help with design, implementation, and operations. From architecture to production.

Contact us