Why containerize apps?

Problem Statement

Running two or more Microservices in isolation on same or different hosts in a cost effective way.

Possible Solutions

There are two approaches which can handle this problem -

Virtual Machine vs Application Container

For comparison of these two approaches, I considered VirtualBox VMM and Docker container. VirtualBox was first released in 2007. Docker was first released in 2013.

Docker containers vs. virtual machines

Source Image: Docker containers vs. virtual machines

From above picture we see a typical VMM provides containment for Operating Systems and Docker provides containment for Applications. Based on this following are the Technology Differences between an Application Container like Docker and a Virtual Machine Manager like VirtualBox -

While researching for technology comparison, I also learned the key motivations for inventing application containers versus VM boxes -

Docker’s container software nearly always runs on a VM. But again, the VM is a set and forgets its infrastructure, so having Docker run on them builds more flexibility. Additionally, if you choose to run containers on bare metal, it may not be a common implementation, but is a huge benefit to performance.

So next question is when to use application containerization?

In an ideal deployment container-based applications are delivered as a series of stateless microservices vs. the more traditional monolithic model found with virtual machines. With that context here are three scenarios to consider when deciding where to deploy your application -

Conclusion

By comparing the container stack with its predecessors, we learned that containerization is the fastest, most resource-effective, and most secure setup we know to date. Containers are isolated instances that run your applications. These lightweight instances can be replaced, rebuilt, and moved around easily. This allows us to mirror the production and development environment and is a tremendous help in the continuous integration and delivery process. The advantages containers can provide are so compelling that they’re definitely here to stay.

Link to code repository

References

[Technical Breakdown: Application Containers vs Virtual Machines]

[Performance: Docker Tool vs Virtual Box VMM]