What is Application Containerization?

Learning objectives

• Explore the benefits of containers
• Examine the way containers work versus virtual machines
• Determine what's needed to work in a containerized environment

LogDNA-Learn-DevOps-What is Application Containerization

Application containerization transforms your virtual machine (VM) or physical server application environment into a compartmentalized environment that typically runs in the cloud. As more organizations find value in cloud computing, application containerization and orchestration tools have become a popular technology to test and deploy applications to the cloud.

The technology offers several benefits - mainly that it’s less resource-intensive, scalable, and can save on IT and hosting costs. You may be interested in changing your current environment to a containerized infrastructure, but first you need to know the benefits and what’s needed to get started.

How are containers used?

It’s not uncommon for large enterprise organizations to have a large codebase where developers continue to add features and updates throughout the years of the software development lifecycle. Monolithic codebases create bottlenecks in testing, deployment, and the overall lifecycle. Several developers could have multiple files checked out, and just one error could affect the entire application. The entire application must be compiled, tested, and redeployed for every update and added feature. This process adds time to development where new code might not be integrated into the production codebase for months.

In a containerized environment, the application is cut into components called microservices, where each component runs in its own pool of containers for high-traffic applications. These containers are decoupled from the underlying environment and run independently from one another. They communicate and work together using REST APIs, but should one component fail, only this particular component must be analyzed, fixed, and re-deployed.

Developers working on one component can also take advantage of containers and deploy to their laptop, a virtual machine, or a private cloud location. They can test and review the code individually without the need to deploy a large compiled codebase, configure it, and then bug fix. Containers and their configurations can be automated, so a “click and deploy” method can be used to create a container, run the application, and destroy it when developers are finished testing. The same “click and deploy” can be used in deployment to production offering more rapid deployment.

What are the benefits of containers and containerization?

Aside from the many deployment and testing benefits highlighted in the previous section, containerized applications have several other benefits. Many of the benefits are based on the way containers run compared to older virtual machine environments.

LogDNA-Learn-Benefits of containers and containerization explained

Virtual machines (VM) run different operating systems using Hypervisor, which allows the guest operating system to communicate with the underlying host kernel. Any applications deployed to the environment are limited to the allocated physical hardware and can’t directly communicate with the host kernel. The container runtime uses the underlying operating system but offers a much more lightweight option as the application containers communicate with the host operating system kernel directly. This results in faster applications, more streamlined deployment, and an isolated environment where one container failure does not affect other containers.

A few other benefits include:

  • Portability: you can deploy containers between cloud vendors eliminating vendor lock-in based on code.
  • Lower resource use: the way containers run make them less resource intensive and reduce total IT costs for application hosting.
  • Automation: containerized environments and automation work well together as containers can be created and configured using orchestration tools such as Kubernetes, Docker Swarm, or OpenShift. The large cloud providers (Google, Amazon, and Microsoft) also let you use orchestration tools such as Kubernetes. AWS has its own orchestration tool as well named Elastic Container Service (ECS) .
  • Scalability: containers can be pooled to increase or decrease resources as application traffic spikes and drops down to normal levels.
  • Security: because containers are isolated from each other, a compromise of one container does not affect the others.

What do I need to work in a containerized environment?

Containers are used for several business purposes, not just development. For instance, server and network administrators can use containers to deploy applications such as logging tools that send log events to an aggregation platform for analysis of anomalies and potential intrusion detection. Data scientists can use containers to run scenarios in machine learning development and analysis. Security researchers can use containers to isolate malicious code or suspicious malware to identify its payload and develop detection and removal tools. Big technical companies such as Uber, Netflix, Spotify, Google, Salesforce, Facebook, and Twilio all use containers to help reduce IT costs and speed up the software development lifecycle.

If you use one of the big cloud providers (e.g., Google Cloud Platform, Microsoft Azure, and Amazon Web Services), you already have access to container technology. What most people lack in the beginning is an orchestration tool. Orchestration tools automate deployment to the cloud and configure the container during deployment. Containers are usually created and destroyed, so when updates are deployed to the cloud, the current container is removed and a new container with the newly compiled and configured code is deployed.

Orchestration tools require a bit of a learning curve to script the deployment actions and test solutions to ensure that it’s functioning properly. Popular tools for deployment are Docker containers with Kubernetes (Kubernetes is often spelled “K8s” and pronounced as “Kates”) for automation and orchestration.

Other than the above tools and cloud environment, many coding tools work directly with containers due to the environment’s popularity. For instance, if you use Visual Studio as your development tool, it will work with container development and deployment.

Usually, the largest overhead when moving an application to a containerized environment is refactoring code from a large monolithic codebase to smaller components. Depending on the application, it can take possibly years to complete, but the end-result is well worth the benefit. Development performance improves, your IT costs decrease, and scaling will support an application that grows with popularity and traffic.

Table of contents

Logging in the Age of DevOps eBook