{"id":4546,"date":"2017-08-03T22:04:12","date_gmt":"2017-08-03T22:04:12","guid":{"rendered":"https:\/\/redmonk.com\/jgovernor\/?p=4546"},"modified":"2017-08-03T22:04:12","modified_gmt":"2017-08-03T22:04:12","slug":"when-production-is-your-test-lab-what-is-canarying","status":"publish","type":"post","link":"https:\/\/redmonk.com\/jgovernor\/when-production-is-your-test-lab-what-is-canarying\/","title":{"rendered":"When production is your test lab &#8211; what is &quot;canarying&quot;?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4aDZHQAfRp0PzTm6kZ9Oq6gYe08OcBz5tMtT1B9mgUyB1RlBTpio03EDT6yobze4IzYLzUW9Up6tM8QzyEVvFaE5TDonEiGi-ca5Zi5p4nSGfXSB5yBFza6Sd8D4YdYd0mQDLcyM\" width=\"578\" height=\"431\" \/><\/p>\n<p>If you\u2019ve attended an infrastructure conference recently, particularly of the \u201ccloud native\u201d variety, you\u2019ll likely have heard the term \u201ccanarying\u201d. If you don\u2019t know what that means you\u2019ve probably nodded along sagely and thought, oh I better look that up. I\u2019ll do it when I look up \u201csmoke testing\u201d.<\/p>\n<p>So anyway &#8211; what is canarying?<\/p>\n<p>A canary test reduces risk by pushing out a change to a small subset of users before it is deployed to your entire infrastructure, and the rest of your users. Sounds simple, but obviously you need a pretty sophisticated development and operations infrastructure to do it properly. You start by deploying the change to a subset of a load balanced infrastructure that is currently not being used. Then gradually route a small number of requests to the new service. These might be random, or employees, or some other specific set of users first. As you become more confident in the change you route more users to it, and then begin to deploy change to more servers. You do want to run the older version in parallel for a while though, in case a problem emerges and you want to route users back to that.<\/p>\n<p>We used to call this kind of approach \u201cphased rollout\u201d but &#8220;canarying&#8221; sounds better, and the practice has come a long way over the last couple of years, in terms of technology and process &#8211; cloud, containers, microservices. For the state of the art in canarying at scale check out what Netflix is doing. I was reading a recent post on the Netflix tech blog about the <a href=\"https:\/\/medium.com\/netflix-techblog\/chap-chaos-automation-platform-53e6d528371f\">Chaos Automation Platform<\/a> and at first I thought \u201cgee whiz pass the salt\u201d but then I paused and took a step back to appreciate the breath-taking achievements of the engineering team. Of course we\u2019re not all Netflix, and we shouldn\u2019t try to emulate everything they do &#8211; premature optimisation is a killer. But that doesn\u2019t mean we can\u2019t all learn from the company, and luckily they are pretty happy to share their experiences.<\/p>\n<p>Here is the Netflix testing approach over time..<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/zkcUKQgXjwKcr724qlX1dcktpNaZvjURENnhLmr7vXK42mcb3j2ZRaa5buqZXiBIsIxov2JbOfJTdRSNVJeh8hf1eZgsSSrMMoDI1tgb64LtiTSyYwvLAh-noj7j6jDp5c2TxyvJ\" width=\"624\" height=\"468\" \/><\/p>\n<p>Netflix asks profound questions<\/p>\n<p style=\"padding-left: 30px;\">\u201cThe best experiments do not disturb the customer experience. In line with the advanced Principles of Chaos Engineering, we run our experiments in production. To do that, we have to put some requests at risk for the sake of protecting our overall availability. We want to keep that risk to a minimum. This raises the question: What is the smallest experiment we can run that still gives us confidence in the result?\u201d<\/p>\n<p>One of the ways Netflix is an outlier is in how many changes it makes over a relatively short term frame. When changes are being deployed to microservices that you are not in control of, canarying gets more interesting.<\/p>\n<p style=\"padding-left: 30px;\">\u201cAny change to the production environment changes the resilience of the system. At Netflix, our production environment might see many hundreds of deploys every day. As a result, our confidence in an experimental result quickly diminishes with time.&#8221;<\/p>\n<p>There is a reason Netflix calls it &#8220;Chaos Engineering&#8221;. As ever you should <a href=\"https:\/\/martinfowler.com\/bliki\/CanaryRelease.html\">read Thoughtworks<\/a> on this stuff.\u00a0 Tomorrow we\u2019ll talk about \u201csmoke testing\u201d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve attended an infrastructure conference recently, particularly of the \u201ccloud native\u201d variety, you\u2019ll likely have heard the term \u201ccanarying\u201d. If you don\u2019t know what that means you\u2019ve probably nodded along sagely and thought, oh I better look that up. I\u2019ll do it when I look up \u201csmoke testing\u201d. So anyway &#8211; what is canarying?<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"class_list":["post-4546","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9wfjh-1bk","_links":{"self":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/4546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/comments?post=4546"}],"version-history":[{"count":0,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/4546\/revisions"}],"wp:attachment":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/media?parent=4546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/categories?post=4546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/tags?post=4546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}