Not sure if the new version/feature would work unerringly in the production environment? Or whether the users would like the new feature you developed? Then this article is for you. Regardless of the immense testing in lower environments, there is always a chance of bugs in the production environment. Canary releases can help pro-actively correct these bugs and prevent errors from happening in your production environment.
What is a canary release?
A canary release is a technique to moderate and mitigate the risks related to the introduction of a new version in your application by cautiously rolling out the changes to a small subset of users before introducing it to the entire platform and making it available to all the users. The term “canary release” comes from the well-known phrase “canary in a coal mine,” which originated from when coal miners used canaries to speculate the presence of toxic gas in the coal mines. Similarly, canary releases can help speculate the effects of introducing a new version in your application.
Diverting a small portion of traffic to the canary version using Amazon Route 53
How can a canary release keep the production safe?
When doing a canary release, the new version is only available for a very small subset of users, generally 1-5%. This can be done by diverting a small portion of the traffic to the new version while routing the rest to the old version. The traffic that is being forwarded to the canary version needs to be monitored for metrics such as CPU, Memory, Disk, etc. At the same time, the user’s feedback can be collected. The users’ feedback and monitoring can help fix bugs and obstructive changes that the new version has introduced. Also, it gets simpler to choose whether the new version ought to be presented or not. If the canary version is stable, has positive feedback from the users, and is performing up to the mark, then the traffic can be gradually shifted to the new version and the old version can be phased out.
Canary release requirements.
A canary release requires both versions of the application to run in parallel and a mechanism that can divert the traffic in the desired ratio. The routing mechanism should be programmable to support the incremental shift of traffic from the old version to the new version. Another requirement is the ability to monitor the canary version by collecting values from system performance counter and application logs, IBM developed CanaryAdvisor which can be used to continuously monitor the baseline and canary versions of a microservice application. Most cloud-deployment services support mechanisms to implement canary releases. You can leverage these cloud services and can set up your canary release within a few clicks.
Organizations following canary release strategy
Some leading organizations that are known to use the canary release pattern: