DEV Community

AK DevCraft
AK DevCraft Subscriber

Posted on • Updated on

Containerization Vs Virtualization, which is better and why?

In the last post, I described that what are the differences between Private and Public clouds (here is the link to it private-vs-public-cloud-computing). As a next step, I'm going to talk about the differences between Containerization and Virtualization (Virtual Machines). So, let's dive deep in.

Virtualization

The virtual machine is virtualization where one or more virtual machine runs on the same physical hardware, this way you get the advantage of utilizing more resources as compared to running application on a single hardware. In the case of virtual machine (VM), we have the underlining hardware and on top of it hypervisor (a component that creates an abstraction on top of the actual hardware that lets you run the virtual machine).
Then, as a part of the virtual machine, you package the operating system, OS dependencies, runtime libraries. The application code is deployed on it. Below is an illustration of VM.

Virtual Machines

Containerization

When compared to the virtualization, containerization is lightweight as operating system (OS) is not packaged as a part of the container. You have the hardware, OS, Docker (there are other abstractions similar to Docker, but it’s the popular one). On top of Docker, you deploy the container where you package just the runtime libraries and the application code.

Containers

Comparison

Parameters Virtualization Containerization
CPU and Memory Utilization Because OS consumes a lot of resources, and every VM has its own OS. That results in higher utilization of CPU and memory OS is shared across all containers. That results in lower utilization of resources
Disk Space Consumption Again, as every VM has its own OS, resulting in more disk space consumption Shared OS results in lower disk consumption
Boot time Little slower, mostly in minutes Faster boot time, mostly in seconds
Isolation As an advantage, independent OS results in more isolation Less isolation due to shared resources

My Other Blogs:

If you have reached here, then I did a satisfactory effort to keep you reading. Please be kind to leave any comments or ask for any corrections. Happy Learning!

Top comments (0)