One of the hot technologies of the modern tech world is none other than containers. Some believe that the increasing popularity of container technology will eventually kill virtual machines. But is that true? We will take a quick look at this topic
Traditionally, applications were deployed on bare metal servers, yes the physical one.It was great as it provides high computational capability.Then you may think then why virtual machine.The answer to that is the dependency issues and high availability.
Instead of having a single instance of our application serving the request we can create virtual machines and run applications in them, there by it reduces the coupling of application modules.Thus it helps to deploy parts of program or modules in separate virtual machines there by help to improve availability and scalability.
Like every other technology out there Virtual machines also have there own limitations, Main issues are listed below
Each virtual machine will have there own operating system and have there own library files. This causes the wastage of resources as our critical application will not be able to utilize the entire allocated resources (CPU,RAM etc).
OS requires licensing (in case of windows) patching, and a team to maintain it.This increases the overall cost of the project.
When the number of virtual machines increases the chance of security threat is also high so data protection also gets a hit.
Lets see how containers helps us to overcome some of the issues we discussed here.
A container is a run time instance of an image.Looks confusing right?. Lets examine what it means
In container world an image is nothing but a file which contain the following data
application code, libraries, tools, dependencies and other files needed to make an application run
Here one thing to note is there is no Operating system listed, reason is that container uses the underlying operating system or the kernel of the host. So for 10 containers there is no need on 10 OS.
There are many containerization runtime available most popular one is the Docker.
Docker allows us to create containers from image.
Note: We will upload separate session on docker and container creation process in the future
Now Lets come to real question will container replace virtual machines?
The answer is NO. Why?, Because they both are not same and there use cases are entirely different.
Container and typically used in programs that focus on micro service architecture. Micro service means a complete program is divided in to modules ( payment module, user data collection module ,processing module..). Each of these service is deployed in a container separately so that we can easily scale the module independently as per our requirement. Also making changes to one module will not affect others as they are loosely coupled.Containers are useful for deploying stateless application like a web server front end, deployment of stateful application like a databases are not recommended to be deployed as container.
Virtual machines are useful when deploying monolithic applications ( complete application),and databases they are easy to deploy and manage than containers.but major drawback is scalability and availability.
Virtual machines are typically used in enterprises for creation of Virtual servers rather than deploying applications.
Lets say you want to have a Linux nginx server and a Microsoft Active directory or a DNS services.This deployment is not possible with containers. This is where VMs shows its power, We can easily deploy 2 VMs, one with linux based OS(Ubuntu or red hat) for nginx and other one with Windows server 2019 with active directory and DNS role installed.
Now lets see the architectural difference between a virtual machine and container.
(image source : Docker)
The main thing to note here is that in containerization, there is no guest Operating system in each container, so a hypervisor is not required. Hypervisor is software that helps distribute resources virtually to all the guest OSes.
Virtual machine software : VMware, Virtual Box, KVM
Containerization software: Docker, containerd, and podman
The popularity of containerization will not cause harm to virtualization.instead, by combining the power of both virtualization and containerization , end users can build highly reliable and available applications
About the Author
Aswin ks
Also Read: