DEV Community

Nishkarsh Raj
Nishkarsh Raj

Posted on

Explain the need of Containerization like I am five?

I am a beginner in the field of containerization and tools like Docker, Kubernetes give me a hard time.
Can someone please explain the concepts in a simple manner?

Top comments (10)

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

talking about docker: it's like a virtual machine with the environment and the project on it.

This can ensure working on the same environment on any stage (development, test, production).

Moreover when formatting or getting a new computer or hiring a new dev there's no need on wasting a morning preparing the working environment, you simply raise the docker and that's all.

This is also applicable when working on different projects.

For example I'm hands on a monolithic MVC with php, mysql, html, sass, js, smarty templates (which are 2 dockers, one for the DB and another for the php, symfony, smarty, html, css, js, webpack...)
Then another project with Angular (with webpack), another with Preact (with parcel.js), another using vanilla js, css, html, parcel and so.

At this point there's no need on installing all things on the main machine and switch between each project configuration needs each time a dev put its hands on a new (or existing) different project or switching work spans from a project to another. You again raise the docker and you can work in minutes. Oh and, that way you can maintain the developer preferences about system and software too. On my team there are people using Mac, others Windows and others Linux (different distributions each).

You can also raise as many dockers as you want or need (and your computer resources permits).

On deployment you also have a benefit such deploying the docker or pod (which is not needed but you can do it) the same way you raise it on any machine.

If you want you can also make a deploy machine where to raise docker, perform some builds into it and then send this "compiled, transpilated, minified, obfuscated" result into production "as is" on your CI script.

So, to resume:

  • Faster software delivery cycles
  • Better Application portability
  • Shines for microservices architecture
  • More efficient usage of system resources

Problems that docker containers don't solve:

  • It won’t fix your security issues
  • It doesn’t turn applications magically into microservices
  • It isn’t a substitute for virtual machines

BONUS: If you are on Linux (windows and mac have docker gui) you'll be used to throw the same commands each time you arrive at work, those actions can be easily automated.

Collapse
 
nishkarshraj profile image
Nishkarsh Raj

That's a very comprehensive response. Thanks a lot! I see some new terminologies but I would try to understand them and also go through your blogs 👍 ❤️

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

You must always check the official website of each technology you're interested in and lean the description and what is meant to; in fact each new tech must solve one or more issues or at least, automate tasks. That way you can internalize what is intended for and discern if it fits into your needs or not, also it's good to ask to the community as you did so you can get opinions and comments based on community's experience :)

Collapse
 
mcastellin profile image
Manuel Castellin

Life With Virtual Machines

Once upon a time in a faraway land, an evil school teacher would force her students to carry the English dictionary to class every day. The dictionaries were HUGE and heavy, and you wouldn't even be able to fit one in your backpack sometimes.

These young students were so worn out. Their backs would hurt all the time, and, even though they were using the dictionary only for a minute each every day, they still would have to carry it a long way from home and back, day, after day, after day...

Life With Containers

One day, a young boy named Docker, who was attending the evil teacher's class, had an idea: "Teacher? Why every one of us has to carry a HUGE and heavy dictionary all the way from home, only to use it just once in an entire day? Wouldn't it be better to have one dictionary in the middle of the class for every student to use? Whenever we need to find a word, we can just bring our notebook and pencil, search for the word, and then we can go back to our desk".

"NONSENSE!!" said the teacher, "Why would you want to use the same dictionary! What if it is busy when you need it? You are not the only boy in class, silly!"

So another classmate whose name was Kubernetes, had another idea: "Well, teacher, we can see how many times we have to queue for the dictionary, and if that happens too often, we can always bring another one, and scale up to two dictionaries, or three, or four, until we know we won't have to queue again!".

Luckily the teacher was also reasonable😅 and she listened to the two young boys. From that day the students didn't have to carry a heavy bag from home and they lived happily ever after.

To all five years old boys reading this forum...

hope you liked the story! 😄 To you Nishkarash, the great thing about Docker and containers is that it allows you to package applications so they won't need a whole lot to run and don't occupy all your system's resources all the time.

All containers running in your system will share the resources and use them only when needed (as opposed to a virtual machine where you need to allocate them exclusively).

If you then need to run the same containers at scale, serving thousands or millions of requests, then Kubernetes is a so-called Container Orchestrator, meaning it will take care of starting, stopping, replicating your container and organize them in a way to serve all incoming requests without to much latency.

If you laughed even a little bit reading this story...

I would appreciate you subscribing to my YouTube (link in my profile) and support my channel. There I want to educate developers about Docker, container technologies and DevOps, I think you will find the channel useful 🙂 when you do, drop me a comment and say hello!

Have a great day!

Collapse
 
nishkarshraj profile image
Nishkarsh Raj

That is one of the best and simplest explanation of containerization I have ever read. ❤️
I would definitely subscribe to the YouTube channel.

Collapse
 
thesksamim profile image
thesksamim

hello .

Collapse
 
tirthaguha profile image
Tirtha Guha

Containers are an abstraction on the environment of the application. If you need to run your application in Ubuntu, but your infra has CentOS only, then containers save you. It also protects you from unforseen issues with roles and permissions, networking issues, etc.

Collapse
 
quinncuatro profile image
Henry Quinn

If you're okay with a different post, I actually wrote a good bit about the benefits of containerization and how it can help you out in a work scenario:

dev.to/quinncuatro/the-promise-of-...

Collapse
 
qoyyuum profile image
Abdul Qoyyuum

There's lots of answers to this around the Internet. Like this one for example: quora.com/What-is-Docker-Please-ex...

Collapse
 
nishkarshraj profile image
Nishkarsh Raj

Thanks, appreciate it :)