Blue / Green Deployments for Cloudflare Workers

Blue / Green Deployments for Cloudflare Workers

We all know it can be a lot of stress to update a running production application and blue/green deployments can go a long ways to reducing that stress. We’ve been playing with implementing blue/green releases for our Cloudflare Workers and are pretty excited about the results.

Blue/Green deployments let us get a new version up and running before we ever send production traffic to it. When we’re ready we can route a small amount of traffic (Canary release) to the new backend and then slowly increase the traffic until it’s all been shifted over. Alternatively we can run an A/B test between the two backends.

We just published an example repo implementing blue/green deployments for Cloudflare workers. It features:

  • Blue / Green workers

  • Proxy worker implementing Canary releasing and A/B testing

  • Optional release versioning and history with AWS S3 bucket

  • Infrastructure as code - deployed with Terraform (you just need to manually point your nameservers at Cloudflare) - nothing is done through the Cloudflare UI

  • Convenient bash scripts for deploying

You can read more over at the repo: GitHub - DigitalOptimizationGroup/blue-green-cloudflare-workers: Blue / Green Deployments for Cloudflare Workers

Let us know if it’s useful for you.

8 Likes

Dude this is awesome. I was just walking some folks through this concept last week, so your sample is quite timely.

2 Likes

This is freaking awesome, thanks for sharing it under an open license too!

1 Like