Overview of Container technology
Before we dig into containers let’s talk little bit about where containers came from, So what are we doing 5/10 years back or some of you still doing.
Traditional Application Deployment:
Software application are typically deployed as a single set of libraries and configuration files to a runtime environment. For example, how we are deploying our application, typically application is deployed on top of hardware ->on top of operating system -> and usually using some sort of virtual machines or something similar.
Let’s take an example of deploying python and java application illustrated in the above diagram, both applications(python and Java) requires library to deploy the application as you can see python need separate libraries and java application need separate libraries to run in-fact both the application using some common libraries.
Now problem with the traditional way of deploying application is that they are tightly coupled with operating system, so incase anything changes on operating system layer, Will be directly going to affect those applications. Not only that but if anything changes on the libraries also will affect the both applications, Now let’s take an example : If there is any update for one of the library (shared lib) and need to update, So once we update the library we have to go and test our applications all over again, In this example we have only two applications , imagine If you have 10/12 applications deployed on it then it will be lot of effort to test all the applications Which off course is not an very viable strategy for an organization to scaling out.
So now this leads organization to go with new way of application deployments , It leads user needing fast and lightweight way to spin up the virtual machines, virtual machines are great but still they are very heavy because they took very long to start ups they include lots of thing we necessarily needs and they still have problem where we still going to tightly/closely coupled for our applications. So we gratefully had a way to sort of isolate for these virtual machines in a better way and if it can be more lightweight so that it can startup more faster, So this is where container is born.
What are containers?
Containers are set of one or more processes that are isolated from the rest of the system. They provide many of the same benefits as a virtual machine.
When I say process that means process that can be starting application server, mysql server, so when you think of process you can really think of your application.
So again, lot of same benefits as virtual machines but they(containers) have some benefits on top of virtual machine here are few…
Low hardware footprint: It uses operating system internal features (Linux kernel) , such as cgroup(control groups) and namespaces to create an isolated environment, minimizing CPU and memory overhead.
Quick and Reusable Deployment: Containers deploy quickly because there is no need to install the entire underlying operating system. Using an single image allows for creating multiple containers from the blueprint.
For example, you can keep your image blueprint on any repository and use it for your container creation.
Environment Isolation: Containers work in a closed environment where changes made to the host OS or other applications do not affect the container.
Multiple Environment Deployment: Containers are highly portable you can move them anywhere you don’t have to worry about that its works on development environment, but it won’t work on staging or production etc. You know your container is reliable because you are passing everything on image so all your specification will be available on your container.
In a traditional deployment, any environment differences could break the application. With containers, all application dependencies and environment settings are encapsulated in the container image.
Comparison:
Traditional Vs Container
Remember we have three application running you can see in the left diagram and these applications are using tradition architecture where they are borrowing the library from host operating system hence these three application are not truly isolated from each other that is becoz how tightly coupled they are to each other inherently by using the same library on the HOST operating system, So if anything would be change on one of library we don’t know what could be the effect on the app1, app2 and app3.
Now lets talk about container architecture on the right side of image , So container architecture says lets change whole paradigm and where we are going to bundle all of libraries that app1 needs and we are going put into its own isolated environment and lets do exact same thing for app2 and app3. So tomorrow if there is update for app1 library we don’t have to worry about app2 and app3, by doing this we are cutting to test app2 and app3 we just need to test app1. Because of this we are not needing to install entire host operating system, since we are only using and updating the container operating system which is base operating system for containers.
What is Container Operating System?
Since containers package so many of the libraries and subsystems that once were part of the operating system into the container, there’s increasingly less need for traditional operating systems. In their place have sprung up a group of lightweight operating systems that significantly reduce the footprint of the operating system.
Happy Learning…