{"id":670,"date":"2018-10-21T20:06:36","date_gmt":"2018-10-21T20:06:36","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=670"},"modified":"2018-10-22T22:19:25","modified_gmt":"2018-10-22T22:19:25","slug":"welcome-to-the-era-of-immutable-infrastructure","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/21\/welcome-to-the-era-of-immutable-infrastructure\/","title":{"rendered":"Welcome to the Era of Immutable Infrastructure"},"content":{"rendered":"<p>With the recent \u201ccontainer revolution,\u201d a seemingly new idea became<br \/>\npopular: immutable infrastructure. In fact, it wasn\u2019t particularly new,<br \/>\nnor did it specifically require containers. However, it was through<br \/>\ncontainers that it became more practical, understandable, and got the<br \/>\nattention of many in the industry. So, what is immutable<br \/>\ninfrastructure? I\u2019ll attempt to define it as the practice of making<br \/>\ninfrastructure changes only in production by replacing components<br \/>\ninstead of modifying them. More specifically, it means once we deploy a<br \/>\ncomponent, we don\u2019t modify (mutate) it. This doesn\u2019t mean the component<br \/>\n(once deployed) is without any change in state; otherwise, it wouldn\u2019t<br \/>\nbe a very functional software component. But, it does mean that as the<br \/>\noperator we don\u2019t introduce any change outside of the program\u2019s<br \/>\noriginal API\/design. Take for example this not too uncommon scenario.<br \/>\nSay our application uses a configuration file that we want to change. In<br \/>\nthe dynamic infrastructure world, we might have used some scripting or a<br \/>\nconfiguration management tool to make this change. It would make a<br \/>\nnetwork call to the server in question (or more likely many of them),<br \/>\nand execute some code to modify the file. It might also have some way of<br \/>\nknowing about the dependencies of that file that might need to be<br \/>\naltered as a result of this change (say a program needing a restart).<br \/>\nThese relationships could become complex over time, which is why many CM<br \/>\ntools came up with a resource dependency model that helps to manage<br \/>\nthem. The trade-offs between the two approaches are pretty simple.<br \/>\nDynamic infrastructure is a lot more efficient with resources such as<br \/>\nnetwork and disk IO. Because of this efficiency, it\u2019s traditionally<br \/>\nfaster than immutable because it doesn\u2019t require pushing as many bits<br \/>\nor storing as many versions of a component. Back to our example of<br \/>\nchanging a file. You could traditionally change a single file much<br \/>\nfaster than you could replace the entire server. Immutable<br \/>\ninfrastructure, on the other hand, offers stronger guarantees about the<br \/>\noutcome. Immutable components can be prebuilt before deploy, and build<br \/>\nonce and then reused, unlike dynamic infrastructure which has logic that<br \/>\nneeds to be evaluated in each instance. This leaves opportunity for<br \/>\nsurprises about the outcome, as some of your environment might be in a<br \/>\ndifferent state that you expect, causing errors in your deployment.<br \/>\nIt\u2019s also possible that you simply make a mistake in your configuration<br \/>\nmanagement code, but you aren\u2019t able to sufficiently replicate<br \/>\nproduction locally to test that outcome and catch the mistake. After<br \/>\nall, these configuration management languages themselves are complex. In<br \/>\nan <a href=\"http:\/\/queue.acm.org\/detail.cfm?id=2898444\">article from <em>ACM Queue<\/em><\/a>, an Association for<br \/>\nComputing Machinery (ACM) magazine, engineers at Google articulated this<br \/>\nchallenge well:<\/p>\n<blockquote><p>\u201cThe result is the kind of inscrutable \u2018configuration is code\u2019 that<br \/>\npeople were trying to avoid by eliminating hard-coded parameters in<br \/>\nthe application\u2019s source code. It doesn\u2019t reduce operational<br \/>\ncomplexity or make the configurations easier to debug or change; it<br \/>\njust moves the computations from a real programming language to a<br \/>\ndomain-specific one, which typically has weaker development tools<br \/>\n(e.g., debuggers, unit test frameworks, etc).\u201d<\/p><\/blockquote>\n<p>Trade-offs of efficiency have long been central to computer engineering.<br \/>\nHowever, the economics (both technological and financial) of these<br \/>\ndecisions change over time. In the early days of programming, for<br \/>\ninstance, developers were taught to use short variable names to save a<br \/>\nfew bytes of precious memory at the expense of readability. Dynamic<br \/>\nlinking libraries were developed to solve the space limitation of early<br \/>\nhard disk drives so that programs could share common C libraries instead<br \/>\nof each requiring their own copies. Both these things changed in the<br \/>\nlast decade due to changes in the power of computer systems where now a<br \/>\ndeveloper\u2019s time is far more expensive than the bytes we save from<br \/>\nshortening our variables. New languages like Golang and Rust have even<br \/>\nbrought back the statically compiled binary because it\u2019s not worth the<br \/>\nheadache of dealing with platform compatibility because of the wrong<br \/>\nDLL. Infrastructure management is at a similar crossroad. Not only has<br \/>\nthe public cloud and virtualization made replacing a server (virtual<br \/>\nmachine) orders of magnitude faster, but tools like Docker have created<br \/>\neasy to use tooling to work with pre-built server runtimes and efficient<br \/>\nresource usage with layer caching and compression. These features have<br \/>\nmade immutable infrastructure practical because they are so lightweight<br \/>\nand frictionless. Kuberentes arrived on the scene not long after Docker<br \/>\nand took the torch further towards this goal, creating an API of \u201ccloud<br \/>\nnative\u201d primitives that assume and encourage an immutable philosophy.<br \/>\nFor instance, the ReplicaSet assumes that at any time in the lifecycle<br \/>\nof our application we can (and might need to) redeploy our application.<br \/>\nAnd, to balance this out, Pod Disruption Budgets tell Kubernetes how the<br \/>\napplication will tolerate being redeployed. This confluence of<br \/>\nadvancement has brought us to the era of immutable infrastructure. And<br \/>\nit\u2019s only going to increase as more companies participate. <a href=\"http:\/\/rancher.com\/quick-start\/\">Today\u2019s<br \/>\ntools<\/a> have made it easier than ever to<br \/>\nembrace these patterns. So, what are you waiting for?<\/p>\n<h3>About the Author<\/h3>\n<p><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2017\/09\/28175821\/wjimenez-photo-300x300.jpeg\" alt=\"\" \/>William Jimenez<br \/>\nis a curious solutions architect at Rancher Labs in Cupertino, CA, who<br \/>\nenjoys solving problems with computers, software, and just about any<br \/>\ncomplex system he can get his hands on. He enjoys helping others make<br \/>\nsense of difficult problems. In his free time, he likes to tinker with<br \/>\namateur radio, cycle on the open road, and spend time with his family<br \/>\n(so they don\u2019t think he forgot about them).<\/p>\n<p><a href=\"https:\/\/rancher.com\/welcome-era-immutable-infrastructure\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the recent \u201ccontainer revolution,\u201d a seemingly new idea became popular: immutable infrastructure. In fact, it wasn\u2019t particularly new, nor did it specifically require containers. However, it was through containers that it became more practical, understandable, and got the attention of many in the industry. So, what is immutable infrastructure? I\u2019ll attempt to define it &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2018\/10\/21\/welcome-to-the-era-of-immutable-infrastructure\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Welcome to the Era of Immutable Infrastructure&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-670","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/comments?post=670"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/670\/revisions"}],"predecessor-version":[{"id":677,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/670\/revisions\/677"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}