VM vs Docker

Nikita Agarwal
CodeX
Published in
5 min readMay 5, 2022
Photo Copyright Nikita

Greetings to all the corporate employees working out there!!

This blog is specifically for freshers like me who have entered the industrial world with minimal industrial and technical knowledge but have a great thirst to grab opportunities and skills from day to day project activities.

Recently while working on a project, my Senior Manager asked whether I am aware of the difference between VM and Docker. That instant made me rethink, is there really a difference or are they the same? It left me blank with the similar thoughts of linking it to the cloud, after all they share the same virtualization concept.

But guess what, I was absolutely wrong!! Though they share the same concept, but have different implementations and benefits.

Before jumping to the proper dictionary concept of Docker, let’s take a quick ride to the older implementation of virtualization that made lifes of developers easier but not that efficient.

The Era of Cloud Revolution

As you all know, being an IT professional, that application runs the businesses nowadays. Whether it be airlines, retail, banking, etc. every business is in need of an application to run efficiently and smoothly.

Back in the mid 20’s applications were run on single servers. And by servers we mean large, expensive, physical tins that were deployed in data centers, which in return asked for additional maintenance charges from the companies as extra expenses on their balance sheets.

Earlier, if a business needed an application for whatever reasons, they had to go out and hunt for a new physical server. It gets them additional cost as well as operational costs added. By additional charges I mean, the power, cooling, a person to administer the stuffs isn’t free of cost.

Now the common question IT had while purchasing is how big and fast servers do they require? This question remained unanswered in their heads. It was difficult for them to define the exact need of the server size and speed. So, IT opted only for the most reasonable ones. Imagine, the choice they made did not turn out to be a boon. And they start losing their customers and revenue just because they cheaped out on a server that wasn’t fast enough.

So, IT always tries to get large and fast servers for their business, though the actual utilized percent ends up to 5–10% of what the server is actually capable of. Eventually, landing up wasting the rest of the server power and space. This signifies a proper waste of the company’s resources and capitals.

To overcome these bad old day’s losses, there came the Virtual Machine(VM) in the picture. So the idea of using Virtual Machine was basically to reuse the extra server space that is remaining and squeeze out the most of it. So, basically instead of using one server per application, businesses now can run multiple applications on a single server.

Boom!! Good job IT operational guys!!! This helped companies save their bucks and developers use the most out of a single hardware space.

But, But, But…… there is always a but to every solution, since there is not always a perfect solution. Let’s dive deep into VM to understand why this is not a perfect solution to the existing problem of utilizing server space.

The VM Era

A server has got processes, memory and disk space inside it and we can run multiple applications on it. Now suppose we want to run four applications on this server, which will indeed need four virtual machines on top of it. Each of these VMs are a slice of the physical server’s hardware. Each VM consists of its own CPU, memory, and disk space taken from the physical server.

Now each of these VMs will require an operating system of their own. Each of the OS will eventually steal a chunk of those resources. We may also need four OS licenses. Now this adds up additional costs for resources. Even though we do not run an application, the OS demands resources to keep it up. It not only adds potential licensing cost but also needs good care and maintenance. There is a whole lot of operational baggage that comes up with each one of the OS like, updating, patching, antivirus management.

There is no doubt on the fact that VMware and Hypervisor have made life easier but there are still issues and there are gains to be made further. This leads us to our main picture “Docker”.

The Docker Era

Before talking about dockers let’s try to understand what containers are. Continuing the above scenario. Let’s say we have a physical server having processes, memory and disk space. In this server we want our four applications to run. So instead of installing a hypervisor on top of it and creating four VMs having specific OS each, we will install an OS and slice the OS into four containers.

Inside these containers we run our apps one each. So instead of having multiple OS and baggage of maintaining them, we have reduced those operational costs and cost of extra resources by installing a single Os and slicing it into required parts.

The best part is containers are comparatively smaller in size than the VMs which makes it more efficient to adopt. The applications inside the containers starts so fast since there is no VM, no hypervisor to boot before starting. There is only one OS that is stealing resources and demanding admin time.

Below is an illustration showing the difference giving a clear picture.

Photo Copyright Nikita

That’s all for today!! Hope this content gave you a clear idea on the difference between VM and Docker Containers.

Will continue the Docker and Kubernetes series as and when I keep exploring and let you also explore through the world of Orchestration and Automation.

Till then Happy Reading!!!

--

--

Nikita Agarwal
CodeX
Writer for

An avid writer and learner. Help people learn from my personal experiences and explorations.