The DynamoDB Book by Alex Debrie. This book covers everything from basics to advanced topics of DynamoDB to master DynamoDB. Get 35% off using “TOWARDSAWS” during checkout.
This week in The Cloud Handbook, let’s talk about containerization. The most widely adopted software packaging technique.
This is the first series of Containers issues. We will be covering a lot of issue around containerization in coming days.
Ok. Here is a story we all might be familiar with in past:
Dev A works on a feature, tests it on his local machine, works just fine, and ships it.
Dev B tries to pull and run on his local machine and it doesn’t work or behave the way it should. Hence this famous meme:
Containerization has solved some of the important issues in software engineering and changed the way we ship software ever since it came in popularity.
Introduction
Containerization is a method of packaging application code into a single unit called a container with all the necessary dependencies that it needs to run.
Containers are designed to be lightweight and consistently able to run on any infrastructure for portability and scalability.
Prior to containerization, to deploy an application, you had to spin up a physical server or virtual machine with an operating system, copy the application source code to the server, install the language and framework your application is written in, and build and run the application.
This was not reliable because each time you had to re-deploy your application, we needed to follow exact steps and make sure you install all required system tools, libraries, and dependencies with the exact versions.
Virtualization vs Containerization
Before containerization was widely adopted to deploy applications, virtual machines were traditionally used to deploy web applications.
In this method, there's a server that is installed as an operation system and a virtualization platform like hyper-v.
When we need to deploy an application, we create a virtual machine with the desired operating system using hypervisor, install the required libraries that your application needs and run the application.
Here are some of the disadvantages of virtualization:
Higher resource overhead
Slower boot times
Greater maintenance overhead
Less efficient resource utilization
Limited portability
Slower deployment
Weaker isolation
Higher licensing costs
Increased attack surface
Less scalable
But, in the case of containerization, we have the server with an operating system and a container engine like docker, and the applications are deployed using containers.
In contrast to virtual machines, the containers do not have their own OS. The containers share the kernel of the host operating system while still having their own file system. This makes the containers lightweight and portable.
How containerization solves the problems of the traditional app deployment process.
To make the deployment process reliable and scalable containerization helps to solve these issues by:
Simplifying the deployment process: Containerization bundles the application with all the dependencies in a container and running the app just requires running the application container
Consistency: When you create a container for your application, it is bundled with the operation system and specific version of system tools that your application needs to run. This makes sure that the app runs consistently no matter the infrastructure the app is deployed in.
Reproducible builds: Containerization platforms like Docker use a configuration file to create the image of the container. Each time you build the image, it follows the exact steps
Scalability: You to run as many instances of your application image enabling you to scale your application rapidly
Conclusion
Containerization has revolutionized how we deploy web apps by creating a lightweight, portable, and scalable application bundle as a container and making deployment easy, reproducible, and efficient.
Over to you, how are you utilizing containers in your daily job? Feel free to share in the comments.
Also, we are trying to improve this newsletter, if you have any feedback for me, reach out via direct message. Your feedbacks are appreciated.
Containers are the way to go. So much so that if I want to try any new technology (Programming Language, Monitoring Tools and so on). The first thing I do is try to dockerize it. haha. Lovely read !!