Containers: Benefits and Making a Business Case
Tags: containers
Published: 2020-04-21 16:32:02

<!-- wp:paragraph -->
<p>Containers are hot stuff right now.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So it’s natural that you’re found your way here wondering what the business case and benefits of containers could be. I’m guessing you are assessing whether containers would make sense for your company? If I’m right — you’re in the right place. <br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>By the end of this article you’ll know what containers are, what their benefits and drawbacks are and you’ll have some decision making criteria to assist you in your business case. <br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We've got quite a bit of ground to cover, so let's get to it.</p>
<!-- /wp:paragraph -->

<figure class="wp-block-image aligncenter is-resized"><img class="aligncenter wp-image-1865" src="https://library.scalyr.com/2018/11/13003110/Containers_leading_to_money_from_a_chart%402x.png" alt="" width="388" height="244"></figure>

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->

<!-- wp:heading -->
<h2>Firstly, What Is a Container?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Before we get into pros and cons, we need to have a basic understanding of what a container is. We need to understand how containers operate and what areas of our company could be positively affected by the implementation of containers.</p>
<!-- /wp:paragraph -->

<figure class="wp-block-image aligncenter is-resized"><img class="wp-image-2129" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/docker-container.png" alt="" width="473" height="376"><img class="aligncenter  wp-image-2762" src="https://library.scalyr.com/2018/09/01045955/docker-container-1024x815.png" alt="" width="318" height="253"></figure>

<!-- wp:paragraph -->
<p>Docker, the current most popular container software on the market defines a container as:</p>
<!-- /wp:paragraph -->

<blockquote class="wp-block-quote">
<p><em>A standardized unit of software</em>.</p>
</blockquote>

<!-- wp:paragraph -->
<p>Sounds pretty vague to me. Anyone working in software will have heard phrases similar to this, such as component, module, or app.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Aren't these all standardized units of software?&nbsp;What makes a container unique?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>According to Docker:</p>
<!-- /wp:paragraph -->

<blockquote class="wp-block-quote">
<p><em>Containers isolate software from its environment and ensure that it works uniformly despite differences for instance between development and staging.&nbsp;</em></p>
</blockquote>

<!-- wp:paragraph -->
<p>Bingo. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This is the real value of containers: isolation. Containers are <em>pretty much</em> isolated processes running on a host machine. I say <em>pretty much</em> since there are some instances when a container isn't truly isolated. But we'll get into that a bit later on.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Why is isolation important? Because isolated software runs with the same behavior no matter where you put it.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This is useful when:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Moving the software between environments, e.g., for testing purposes.</li><li>Moving the software to a different running location, e.g., from on-site servers to the cloud (or even between cloud providers).</li><li>Scaling the software to run compute power concurrently (horizontal scaling), e.g., to achieve high availability or performance requirements.</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>Simply put: <strong>containers allow software engineers to create small, isolated pieces of code that can run on any machine, anywhere, in a </strong><em><strong>consistent</strong></em><strong> </strong><em><strong>fashion</strong></em><strong>.</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Don't worry if this is a little too abstract, because we are going to break it down.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But first, to ensure a balanced discussion, let's look at the alternatives to containers.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Container Alternatives</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>If you’ve been in a tech for a while, my previous statement about creating isolated software could have you raising your eyebrows. Because indeed <a href="https://www.scalyr.com/blog/containers-and-kubernetes-vs-vms-vs-config-management/">there are other methods</a> for isolation and portability that don’t require containers. <br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In order to see the benefits Containers make, we should review some of the alternatives. <br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let's take a quick look at these options.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Alternative 1: Manual Configuration</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Manual configuration is essentially the antithesis to containers. Rather than having your code run in the same way on all machines, you become susceptible to the most fickle errors of them all: human ones.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2148,"align":"center","width":300,"height":300} -->
<div class="wp-block-image"><figure class="aligncenter is-resized"><img src="https://library.scalyr.com/2019/01/14223934/Boat_wheel_with_Scalyr_colors_signifying_Kubernetes_Tutorial-300x300.png" alt="" class="wp-image-2148" width="300" height="300"/></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Manual configuration is simply using an individual, a human, to manage servers or applications. Servers that are manually configured (in <a href="https://www.scalyr.com/blog/devops-engineer-what-does-it-take-to-land-the-job/">what is often now considered</a>&nbsp;a fairly old-school way) are maintained by an <a href="https://www.scalyr.com/blog/sexy-but-useless-devops-trends/">operations team or a systems administrator</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Even though it may be old school, we must consider manual configuration as an option because often, especially for small companies, it can be the most pragmatic solution. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>As we'll soon see, containers can help companies looking to achieve scale, and without the right conditions, adding more complexity to a new project might come with additional risk beyond which makes sense to undertake.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Alternative 2: Virtual Machines (VM)</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Next up, virtual machines.</p>
<!-- /wp:paragraph -->

<figure class="wp-block-image aligncenter is-resized"><img class="wp-image-2130" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/Scalyr2.png" alt="" width="548" height="264"><img class="aligncenter  wp-image-2763" src="https://library.scalyr.com/2018/09/01050156/Scalyr2-1024x494.png" alt="" width="346" height="167"><figcaption><em>Image: Containers vs. VMs (<a href="https://rancher.com/playing-catch-docker-containers/">source</a>)</em></figcaption></figure>

<!-- wp:paragraph -->
<p>For a long time, the tech industry standardized on the idea of virtual machines as a way to create the aforementioned isolation and combat the inconsistencies of manual configuration.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Simply put: virtual machines are small, isolated machines that run within another machine (called the host). I think it's easiest to think of virtual machines as a computer within a computer.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For a long time, I couldn't discern the difference between VMs and containers. The penny finally dropped when I understood containers aren't magic, nor are they just boxes, as they're often drawn. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Instead, they're a protected process running on a machine.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>And because containers are processes, they can share the system resources of their host, unlike virtual machines that require an entire operating system within each virtual machine you want to run. This creates a trade-off between the near-perfect isolation of a virtual machine and the speed and lightweight benefits of a container.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Alternative 3: Serverless</h3>
<!-- /wp:heading -->

<figure class="wp-block-image aligncenter is-resized"><img class="wp-image-2131" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/Scalyr-3.jpg" alt="" width="491" height="396"><img class="aligncenter  wp-image-2764" src="https://library.scalyr.com/2018/09/01050211/Scalyr-3-1024x826.jpg" alt="" width="388" height="313"><figcaption><em>Image: A Serverless architecture (<a href="https://blog.g2crowd.com/blog/trends/digital-platforms/2018-dp/serverless-computing/">source</a>)</em></figcaption></figure>

<!-- wp:paragraph -->
<p>Lastly, the newest entrant in the getting-code-onto-a-server market, <a href="https://www.scalyr.com/blog/how-serverless-will-change-devops/">serverless</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Serverless tackles the difficulties of matching application and infrastructure in a different way: by removing infrastructure from the equation completely.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But how does this work? Surely there must still be a sever?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In serverless, there are still servers that run our code, but this responsibility is passed to a cloud provider. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Instead of putting applications into the cloud as containers or virtual machines, we send small functions of code. These are then run individually based on demand. Serverless can be great for scaling and achieving lower costs, but it also comes with added complexity.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Serverless and containers are comparable, but they’re not direct competitors. By design serverless ties you to a cloud provider. While some tools such as <a href="https://serverless.com">Serverless Framework</a> help you minimize the lock-in, you might be losing out on a lot of the benefits. <br></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Companies who adopt serverless often benefit by going fully cloud-native and embracing all of a cloud provider's features without fear of lock-in. So, if cloud agnosticism is a goal, containers could be a better choice than serverless.<br></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Benefits of Containers</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Hopefully by now you have a good grasp of what a container is and what the alternatives are: manual configuration, VM's and serverless. With this base of knowledge, let's move onto looking in more detail at the specific benefits of containers.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Benefit 1: Deployment Flexibility</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Containers don't have to just work for applications such as websites. Since they are simply processes, it's easy to scale them and use them for different purposes.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Containers also work for other ad-hoc and operational tasks, such as: </p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Database schema updates </li><li>Performance testing. </li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>For instance, recently I launched a performance testing suite on a fleet of containers. Each container had a performance profile, and I could easily scale it up and down to mimic load for testing purposes.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>These containers could just as easily be run on a local machine as they could on AWS, GCP, or any other cloud provider.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Benefit 2: Cloud Agnosticism (Portability)</h3>
<!-- /wp:heading -->

<figure class="wp-block-image aligncenter"><img class="aligncenter  wp-image-2765" src="https://library.scalyr.com/2018/09/01050231/Scalyr4.png" alt="" width="356" height="192"><img class="wp-image-2132" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/Scalyr4.png" alt=""><figcaption><em>Image: Container portability (<a href="https://www.ibm.com/blogs/bluemix/2015/08/c-ports-docker-containers-across-multiple-clouds-datacenters/">source</a>)</em></figcaption></figure>

<!-- wp:paragraph -->
<p>When it comes to architecture decisions, there will always be a stakeholder who will ask...</p>
<!-- /wp:paragraph -->

<blockquote class="wp-block-quote">
<p>"What if we want to move cloud providers? How hard will that be?"</p>
</blockquote>

<!-- wp:paragraph -->
<p>With containers, the answer is: not too hard.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Containers themselves can run on open source software, such as Linux. They're shipped with a run file, meaning that you'll find their packaging instructions contained within the software, not the cloud provider. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So if you do choose to move your application to a different set of servers, you can do so with relative ease.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Alternatively, a solution such as serverless by its very nature is highly coupled to the cloud provider. This is worth considering if portability is a concern for you.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Benefit 3: Fine-Grained Architectural Implementation</h3>
<!-- /wp:heading -->

<figure class="wp-block-image aligncenter is-resized"><img class="wp-image-2133" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/Scalyr-4.png" alt="" width="522" height="406"><img class="aligncenter  wp-image-2766" src="https://library.scalyr.com/2018/09/01050246/Scalyr-4.png" alt="" width="359" height="279"><figcaption><em>Image: Breaking down a monolithic application (<a href="https://www.parasoft.com/solutions/microservices-testing">source</a>)</em></figcaption></figure>

<!-- wp:paragraph -->
<p>Often a container-based solution for an application goes hand in hand with a microservices-type architecture. In microservices, a large application is broken down into smaller parts that are typically worked on by separate teams and deployed in isolation.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>When separated in such a way, you can scale them horizontally, which simply means that rather than making the machine bigger, you run two of them side by side. This can then give you a fine level of granularity when performance tuning an application, allowing you to scale up and down only where needed.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":1941} -->
<figure class="wp-block-image"><img src="https://library.scalyr.com/2018/11/13003222/Microservices_talking_to_one_another.png" alt="" class="wp-image-1941"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Microservice-type architecture brings additional advantages, as teams can work independent, drastically increasing velocity and speed of implementing change (at least in theory).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On the other hand, microservice architectures are difficult to get right and require expertise and team communication. Split them in the wrong place and you have a very complex, distributed application.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But with containers in place, you have the option of whether to run one giant monolithic-type architecture or break your application down into pieces. You can even put it back together again if you split up your application in the wrong way.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Benefit 4: Easier Employment of Talented Engineers</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A pragmatic—albeit slightly dry—reason to choose containers: resourcing.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Containers are <a href="https://www.scalyr.com/blog/the-devops-job-market/">hot technology in the market right now</a>. Most technology companies struggle to find good developers to work on their products and services. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>So it makes sense to ensure that the technologies we run are desirable by the market and that we can find good staff to work our software.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Drawbacks of Containers</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Okay, so now we've talked a lot of the merits of containers. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But to make sure we get a complete picture, let's take a look at all the ways containers can let us down, or worse: actually hurt our performance and ultimately, our company.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Drawback 1: Additional Complexity</h3>
<!-- /wp:heading -->

<figure class="wp-block-image"><img class="aligncenter  wp-image-2767" src="https://library.scalyr.com/2018/09/01050320/Scalyr6-1024x575.png" alt="" width="360" height="202"><img class="wp-image-2134" src="https://staging-design.scalyr.com/wp-content/uploads/2018/11/Scalyr6.png" alt=""><figcaption><em>Image: Orchestration tool options (<a href="https://coderise.io/container-orchestration-platforms-know/">source</a>)</em></figcaption></figure>

<!-- wp:paragraph -->
<p>Containers don't come alone. Unfortunately, oftentimes&nbsp;<a href="https://www.scalyr.com/blog/devops-past-present-and-future/">running containers means additional overhead in setting up systems to facilitate them</a>. We will need somewhere to store our container images and likely, we'll want what is called a container orchestration tool.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>On a practical level, container orchestration:</p>
<!-- /wp:paragraph -->

<!-- wp:list -->
<ul><li>Chooses how many containers to run at any given time.</li><li>Tells our containers on what hosts they need to run.</li><li>Starts, restarts, or destroys containers.</li></ul>
<!-- /wp:list -->

<!-- wp:paragraph -->
<p>This additional tooling brings with it added complexity. If you were operating in a monolithic architecture scaling might be a simple case of making the host machine really big.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Not only this, but if you go ahead with containers, you'll need to <a href="https://www.scalyr.com/blog/five-reasons-you-need-log-monitoring/">start considering the other tooling</a> you'll want to run. This can be both complex and time consuming.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Just to paint a picture of the current crowded orchestration market: a&nbsp;couple of the main technologies available are&nbsp;<a rel="noopener noreferrer" href="https://docs.docker.com/engine/swarm/" target="_blank">Swarm,&nbsp;</a>by Docker, and&nbsp;<a href="https://www.scalyr.com/blog/five-to-dos-when-monitoring-your-kubernetes-environment/">Kubernetes</a>,&nbsp;an orchestration tool built by Google. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":1873} -->
<figure class="wp-block-image"><img src="https://library.scalyr.com/2018/11/13003122/Docker_whale_coming_out_of_a_container.png" alt="" class="wp-image-1873"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In terms of cloud adoption, naturally Kubernetes comes as a managed service on <a rel="noopener noreferrer" href="https://cloud.google.com/kubernetes-engine/" target="_blank">Google's Cloud Platform (GCP)</a>, but cloud adoption is also possible on Microsoft's&nbsp;<a rel="noopener noreferrer" href="https://azure.microsoft.com/en-gb/services/kubernetes-service/" target="_blank">Azure</a>,&nbsp;with AWS offering its own container orchestration solution called&nbsp;<a rel="noopener noreferrer" href="https://aws.amazon.com/ecs/" target="_blank">Elastic Container Service</a> (ECS).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Most of these orchestration services are fairly new, and the moment you use a service such as ECS on AWS, you begin to couple yourself to that specific cloud provider and lose some of the original portability benefits of containers.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Drawback 2: The Learning Curve</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Implementing new technology is rarely a breeze, despite what the 101 conference talks and the "Hello World" YouTube videos make us think. New technology means training your teams to use it, which means time away from their usual jobs, which may be difficult in your current situation. You should consider the cost that will go into learning something new.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Big Question: To Container, or Not to Container?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>I'm glad you've made it this far, as this is where things get really interesting. Now we're going to take everything we've learned about containers and consider whether or not they will work for your company.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In order to do this, here are the questions you should consider:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Do we have the risk tolerance for additional complexity?</strong> If you are at the start of a project, it may be worth opting for a more simplistic monolith architecture. With this in mind, you could also build, package, and deploy your project in a single container, deferring the complexity of microservices and distributed systems into the future.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>What is your team's level of enthusiasm for containers?</strong> If you're thinking of doing a big switch to container technology, keep in mind that the switch will require <a href="https://www.scalyr.com/blog/growing-a-high-performance-devops-culture/">plenty of enthusiasm</a>&nbsp;from your team. It would be worth your while to check in with your teams before adopting new technologies.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Do you have the ability to train your teams on containers?</strong> If you don't give your teams adequate opportunities to learn new technologies, building in time for experimentation and failure, then your journey to implementing containers could be fraught with difficulty. So consider the amount of time you have available to dedicate to this venture.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Do you have an immediate need for high scale?</strong> Containers could be a good fit for you if you'll need high levels of scale in the near future. If your application is set to serve millions of requests and you'll want to scale independent parts of your application, containers might be the right choice.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>And that's a wrap on our whirlwind tour of containers, their benefits, and their drawbacks. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Hopefully you've had a chance to reflect on whether or not they might work for you. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you've got an immediate need for scale, the ability to take on additional complexity, and an enthusiastic team, then maybe it's time to get going with containers. If you're missing one of these areas, maybe you want to hold off and investigate containers a little more before making your decision.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Containers aren't a silver bullet, but they could be the solution to unlocking a big performance boost for your company. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now, armed with your newfound knowledge about the benefits and risks of containers, you should be able to make an informed decision about whether containers are right for your company. And remember: no setup works for every situation. So keep an open mind, explore, experiment, and stay curious.</p>
<!-- /wp:paragraph -->