Releasing into the clouds
With fortnightly sprint cycles, bringing new features and a few squashed bugs, we are repeatedly releasing into multiple regions – quickly and with zero impact for our clients.
We can do this because we leverage both a microservice architecture and Microsoft’s Azure App Service, combined with the help of a fancy little PowerShell script; more on that later.
Azure’s App service operates at the platform level, meaning we’re not concerned with software or hardware maintenance, allowing us to focus solely on our code. All this means we have more time to focus on the delivery of our ZetaSafe to clients. I won’t dive into what microservices are (check out this blog by our technical director Chris Wiles) to learn more.
The Technical Stuff
We have worked really hard to refine our approach for simplicity; it goes like this
Each microservice operates in multiple regions, each one has both a production slot and a staging slot, with the latter always having the latest development code running.
When we are ready to release we run our PowerShell script which swaps our production and staging slots around. However, our PowerShell script does more than just a swap request, it also includes many checks at each stage of the release ensuring compliance to procedures which mitigate risk during a release.
The automated process looks like this
- All staging slots are checked to ensure they are running the expected build number in the change request.
- One region at a time, a request to begin the swap from staging to production is sent.
- Azure warms up our staging slot with all the production environment variables e.g. database connection settings and checks the service is ready to receive requests.
- Azure redirects traffic to the new production slot meaning zero down time.
- The script then checks the microservice’s status page to ensure the production slot is running, connected to all its services and validates build number for the release.
- Then it moves onto the next region and repeats. We only ever do one region at a time, this allows us to minimise risk and to roll back the release without affecting the service.
- Once all regions are complete, the stale staging slots are updated with the latest code ready for the next release cycle.
- Finally, we post a notification to the team on our communication hub slack (which also automatically distributes it to other media), announcing the release has been successfully completed.
I have uploaded an example PowerShell to GitHub, so click here to check it out and please feel free to leave feedback if you have any ideas on how it can be improved.
Flying through clouds you will always encounter some turbulence, but seamless releases are key to delivering a high quality service; ZetaSafe clients expect to see great new features regularly but don’t expect service interruptions to get them – and we agree!
Trusted by 1000+ education, healthcare, local government and FM organisations; ZetaSafe is the leading cloud based compliance software for health, safety and environmental risk management. ZetaSafe will help you to remain compliant with any requirement but is regularly applied to manage areas such as: water safety, fire safety, emergency lighting, gas and electrical, security, lab QA, routine checking, HVAC and LOLER inspections. For more information visit www.zetasafe.com