Blue-Green Deployment

Blue-Green Deployment

Blue-green deployment allows a new application version to be released without interrupting users. Two separate application environments are maintained, and traffic is moved between them while each environment is updated and verified.

This deployment method is useful when frequent application updates must be delivered while keeping the service continuously available. One environment continues serving production traffic while the second environment is updated, tested and prepared for use.

After the updated environment is confirmed to be stable, traffic can be redirected to it. The remaining environment can then be updated in the same way.

Blue Environment Current or previously deployed application version.
Backend 1
Traffic Distributor Controls how incoming requests are routed between environments.
Traffic Routing
Green Environment Second environment used during deployment and maintenance.
Backend 2

Requirements

  • Two separate application environments containing the same application structure.
  • A Traffic Distributor or equivalent routing service configured in a separate environment.
  • Both application environments connected as traffic-distribution backends.
  • Clear environment names or aliases, such as Blue and Green.
  • A validation process for checking the updated application before routing live traffic to it.
i

Note

Both environments should use compatible application settings, databases, domains and external integrations. Any shared data must remain consistent while traffic is switched between environments.

Blue-Green Deployment Process

1

Prepare the Blue and Green environments

Create or confirm two environments with the same application topology. Assign clear aliases or names so administrators can easily identify which environment is serving traffic and which environment is under maintenance.

Configure the Traffic Distributor with both environments as backend destinations.

Traffic distributed between Blue and Green environments
Initial configuration with both environments available as backends.
2

Route all traffic to the Green environment

Open the Traffic Distributor configuration and change the traffic ratio so the Blue environment no longer receives incoming requests.

Set the distribution to 0% for Blue and 100% for Green, then apply the configuration.

All traffic routed to Green environment
All incoming traffic is routed to Green while Blue is isolated for maintenance.

Recommended practice

Confirm that active sessions, background jobs and open connections have drained from the Blue environment before beginning the update.

3

Update and test the Blue environment

Deploy the new application version to the Blue environment while Green continues serving production traffic.

Complete all required maintenance activities, including application deployment, configuration updates, database checks and functional testing.

i

Important

Do not route production traffic to the updated environment until health checks, application tests and integration checks have completed successfully.

4

Switch all traffic to the updated Blue environment

After verifying the Blue environment, reopen the Traffic Distributor configuration and reverse the traffic ratio.

Set the distribution to 100% for Blue and 0% for Green. Apply the change so Blue begins processing all requests.

5

Update and test the Green environment

Deploy the same application version and configuration changes to Green. Perform the same validation process used for Blue.

At this stage, Blue continues serving users, so Green can be updated without causing downtime.

Restore Normal Traffic Distribution

6

Return to the preferred traffic ratio

After both environments are running the same validated application version, open the Traffic Distributor configuration again and restore the required backend weights.

For example, traffic can be distributed equally between both environments or assigned according to the capacity of each environment.

Rollback option

If a problem is discovered after switching traffic, route requests back to the previously stable environment while the issue is investigated.

Expected Result

The application is updated in both environments without interrupting users. At every stage, one environment remains available to process production traffic while the other is updated and tested.

After the deployment is completed, both Blue and Green environments run the same application version and the Traffic Distributor uses the preferred backend weights.

Important Notes

  • Keep both environments structurally consistent to make traffic switching predictable.
  • Use health checks before and after every routing change.
  • Confirm database compatibility when application versions include schema changes.
  • Avoid running incompatible application versions against the same shared database.
  • Monitor error rates, response times and system logs immediately after each traffic switch.
  • Maintain a rollback plan until both environments have been fully validated.