Zero Downtime Deployments Using IBM Bluemix

Here’s a video I’ve made showing you how to deploy new versions of an application on IBM Bluemix without the end-user having to suffer any down time:

Utilising the Blue Green deployment pattern, we deploy the new version to a separate host within the production environment, rather than taking down and updating the existing application. The HTTP router in front of the applications controls tunnelling application requests between the different versions. Once we verified the new version is working correctly, we can turn off the previous version and transfer all traffic to the new instance.

This complex deployment pattern is automatically supported by the Cloud Foundry technology underpinning IBM Bluemix.

Staging multiple versions of an application, bound to the same external address, with automatic load balancing is handled transparently by the platform.

This works for any language or runtime without any modifications to your application.

There are a few [different ways]( to achieve this deployment approach using the platform. The example in the video only uses three commands with the ‘cf’ tool.

// Rename the existing application to allow staging a new instance without
// overwriting existing version.  
$ cf rename app old_app

// Deploy the updated application, which will be bound to the same external
// address. HTTP traffic is load balanced between the two versions automatically.
$ cf push

// Verify the new application is working and then turn off the old instance.
$ cf stop old_app


Update (July 20th 2018): There is now a CLI plugin for Cloud Foundry that automates this approach. Check it out!