What is Docker Container? Why do we need Containers?

Before we jump to the definition of Containers. It’s important for us to understand why do we need the container. Everyone will agree that most of the business is directly or indirectly dependent on IT. Applications are playing an important role in any business whether it is any backend application, a web application or a Mobile App.

So let’s begin it with the old IT days… Back then one application means one server. Any organization that makes an application needs a server to deploy on it which means we need for any application deployment IT guys need to buy a server, allocate CPU, Memory, and storage to it and this doesn’t end here we need to install Operating system on it, this will overall increase the cost to the company. But the problem is not this. The real problem was to give a reasonable amount of resources to that server so that your application runs properly and what is reasonable, nobody knows that before releasing that application.

Consider a case, a company has developed 4 applications and bought 4 servers to deploy them on each server they have allocated storage, RAM and CPU.

With this traditional approach, there is a major drawback, which is a wastage of resources, like there could be a scenario where application 2 only utilizing 5-10% of the allocated resources.

Then a new revolution comes in IT, which is VMware and Hypervisor.

VMware and Hypervisor are what we had needed all the time, VMware and Hypervisor have solved the problem of One application per server. Now with this, we can have an architecture where multiple virtual machines can be made on a single server and now we have the flexibility to deploy applications on a single server.

Let’s discuss the same problem where we have the same 4 applications. So now with VMs and Hypervisor, the infra looks like this,

Consider, all the Virtual machines have 25% of the allocation of RAM, CPU, and Storage. Now with this approach, we have the flexibility to create 4 virtual machines over 1 server and also we can install the Operating system on each VM’s. But this also has drawbacks.

Each virtual machine needs an operating system that takes a reasonable amount of space and memory. On top of it, it will also increase the overall cost like OS license cost, Admin cost like OS Patching, Updates, Antivirus Protection, etc. To solve the above problem we now have containers.

A container is a method to package code and dependencies together at the application layer. We have one server and one OS on top of that we create many containers. Each container is a slice of the OS and will run on the same server and share the same Operating system.

container

With this container approach, we can now save Admin time, OS resource demand, etc. Also, we can space more server space as containers take up less space than virtual machines (container images are typically tens of MBs in size), can handle more applications and require fewer VMs and Operating systems.

I hope this article has helped you understand the basics of Containers. In my next article, I will cover more about Docker.

Stay tuned!

Leave a Comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: