Containers vs. Virtual Machines and why they are important to modern computing

Most people in the Computer Science field have either heard of or directly interacted with containers or virtual machines. They are an important part of many aspects of modern computing; ranging from massive cloud servers to simply running multiple operating systems on your machine, there are many uses for these tools. Firstly however we should discuss what each of these tools are, how they work, and how they differ from each other.

Virtual Machines: A virtual machine at its simplest works like a normal computer, containing an operating system and any other apps/services that it has been configured with. The difference between a virtual machine and a physical computer is that a virtual machine is purely software that runs on top of the host computer’s hardware without interfering directly with the native operating system. Since virtual machines are just software, that makes them extremely portable, meaning that the user can easily transfer a virtual machine from one device to a completely different one without much hassle. One big downside to virtual machines is that they can become very large in size. Since each virtual machine uses its own OS image, runs its own apps/services it has similar space requirements to the native OS; and running multiple virtual machines on the same host machine only compounds this issue.

Containers: Similarly to a virtual machine, a container is also used to virtualize a system environment; however unlike a virtual machine, a container does not need its own image of an operating system as it shares the host machine’s operating system. This allows containers to take up much less space allowing more of them to be run on the same machine. This also makes them much faster, as containers can start up much quicker than virtual machines. Like virtual machines, containers can also be moved from one machine to another, as long as the new machine has the same OS that the old one did. This brings up the downside to containerization, which is that once the container is configured to the host OS, it’s mated to that OS and will not run with any other operating systems unless it is reconfigured from scratch.

What are the use cases: For someone just looking to run a separate instance of an OS on their machine then a virtual machine will suffice. Instead of buying a new machine for each specific configuration, virtual machines can be used and configured as needed. Containers can also achieve a similar effect, although they would be stuck with the base OS configuration. Where containers really shine is in massive databases, where their smaller size and modularity allows them to perform the tasks they are designed for much more efficiently, and allows for many more containers to fit on one single server. Likewise, containers can also be used for splitting up complex applications throughout multiple containers, allowing developers to make changes to each individual application module without the need to reformat the entire application.

Sources:

https://azure.microsoft.com/en-us/overview/what-is-a-container/#why-containers

https://azure.microsoft.com/en-us/overview/what-is-a-virtual-machine/#what-benefits

https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/containers-vs-vm

Leave a comment

Design a site like this with WordPress.com
Get started