Containers and cost optimizations

Wercker is a Docker-Native CI/CD Automation platform for Kubernetes & Microservice Deployments

Brien Posey
Brien Posey
June 16, 2017

There is an old saying that time is money. Perhaps nowhere does this statement ring truer than in modern development environments. At its core, software development is an effort to automate business processes. The assumption is therefore that the resulting software will yield tangible business value.If software development really is being done in an effort to provide business value, then it stands to reason that it is in an organization’s best interest to complete each development project in as little time as possible. After all, there is a direct cost associated with software development. Since much of this cost is tied to labor, then reducing the amount of time that it takes to develop an application has a direct impact on the application’s total cost to produce. Furthermore, if the application is to provide business value, then the faster the application can be developed, the more quickly the business value can be derived from the application.

Because it is clearly in an organization’s best interest to develop applications quickly, then it makes sense for an organization to look for ways to optimize the development process in an effort to reduce costs, and achieve the desired result more quickly.

One of the ways many organizations are optimizing their development costs is through the use of containers and microservices. The basic idea behind this is simple. Very often, development efforts do not start from scratch. A project might, for example, involve making a modification to an existing application. Even if an entirely new application is being created, there may be sections of code that can be borrowed from an existing application, rather than recreating code that already exists.

In the rest of this article, we’ll take a look at two specific ways in which containers can help save money: first, through the adoption of microservices, and second, by creating an optimized base image.

 

Microservices and money

By using containers and microservices, an organization can break a large, monolithic application down into small individual pieces. This approach makes it easy to maintain, modify, or reuse code. After all, it is far easier to work with a small piece of an application than to work with the application as a whole.

The use of containers and microservices has the potential to streamline development efforts, while also reducing costs. Even so, there is a big difference between adopting a microservice and container-oriented approach to software development, and optimizing the overall costs.

 

Optimizing base images

One of the best ways to optimize the development cost of a containerized application is to spend some time optimizing the base image. As you are no doubt aware, containers do not usually contain a full OS kernel. Instead, containers share a common base image, which acts as the OS kernel for the code running within the containers.

One common mistake that is often made by those who are new to containers is downloading or creating a general-purpose base image. Ideally, a base image should contain only those elements that are needed by the containerized code. In fact, there have been documented instances of companies creating highly optimized Linux base instances that are less than 20 MB in size.

There are several advantages to using a base image that contains only those elements required to support the containerized application. For starters, such images have a much smaller footprint than a general-purpose base image. This means that the image has a smaller attack surface, and may also provide better performance than a larger image might.

It generally also costs less to host a smaller base image than to host a larger image. This can be especially true for containers running in a public cloud, since cloud service providers bill their customers based on the resources that they consume.

Small, highly optimized base images are also likely to require far less maintenance than a general-purpose image. Operating system vendors routinely create patches that address bugs and security vulnerabilities. A small, highly optimized base image is far less likely to need frequent patching than a large general-purpose base image might. Any time that you can do something that reduces the maintenance requirements for a base image, it translates directly into reduced costs.

Another benefit to reducing the size of the base image is that doing so can make it much easier to troubleshoot the containerized application should any problems occur. By eliminating any kernel components that are not essential to the containerized application, you also eliminate the possibility that a non-essential OS component could somehow cause problems for the application.

 

Conclusion

As you can see, there are two main keys to optimizing the costs associated with your containerized application. First, take a microservices approach to the application so that the developers can focus their efforts where they are really needed, rather than having to focus on an entire monolithic application. Second, create a base image that has been specifically designed for the application, and contains no unnecessary OS components.

 

About the Author

Brien Posey is a Microsoft MVP with over two decades of IT experience. Prior to becoming a freelance tech author, Posey was CIO for a national chain of hospitals and healthcare facilities. He also served as a network engineer for the United States Department of Defense at Fort Knox, and has worked as a network administrator for some of the largest insurance companies in America. In addition to Posey’s continued work in IT, he is in his third year of training as a commercial scientist-astronaut candidate.

 

Like Wercker?

We’re hiring! Check out the careers page for open positions in Amsterdam, London and San Francisco.

As usual, if you want to stay in the loop follow us on twitter @wercker or hop on our public slack channel. If it’s your first time using Wercker, be sure to tweet out your #greenbuilds, and we’ll send you some swag! 

 

Topics: Containers