Containers & Containerization – Pros and Cons

Containerizing can be a useful approach to developing applications. While it has many benefits, there are also situations where you might not want to use it. In this post, I’ll cover both the pros and cons.

What Are Containers?

Containers are the result of a packing mechanism that decouples applications from the environment where they would normally run. Containerizing allows applications to be deployed much easier, use fewer resources to run, and stay isolated from an environment where they could cause or be affected by issues.

They also allow developers to work seamlessly with non-developers. Developers can containerize the apps they built and share them with other developers, which in turn will decrease the time it takes to get the app into production.

Pros of Containerization

There are many good reasons to containerize apps.

  • Containers provide a lightweight, fast, and isolated infrastructure to run your applications. Since they are more lightweight, they are more flexible and can be backed up and restored faster.
  • The application, dependencies, libraries, binaries, and configuration files are usually bundled into the container, providing an easy solution to migrating your application anywhere.
  • The average container size is usually less than 100MB, as opposed to a couple of gigabytes used by a virtual machine.
  • Containers can help decrease your operating and development cost.

Cons of Containerization

Of course, there are also a few cases where you might not want to use this approach.

  • Containerization works well for Linux operating systems. However, while Windows has a container environment, it is not supported nearly as much as the Linux environments.
  • Containers share the kernel of the OS, so if the kernel becomes vulnerable, all of the containers will be vulnerable, as well.
  • Networking can be tricky when you’re working with containers. You have to maintain a good network connection while actively trying to keep containers isolated.
  • Containerization is usually used to build multi-layered infrastructure, with one application in one container. This means you have to monitor more things than you would if running all of your applications on one virtual machine.
  • Monitoring your containers is a harder task than it would be on a virtual machine.

A Few Things to Consider

If you’re considering containers for your next project, think about the following:

  • Not every app needs to be containerized, and in some cases, it may not provide any benefits.
  • There are many tools to use for containerization. Right now, Docker is a popular choice.
  • Developers with experience in containerization will be more valuable in the future, as a lot of companies are implementing a “DevOps” mindset to their workflow.

I hope these tips have offered a useful introduction to using containers. Where have you found this approach helpful?