Towards Container-Based Development šŸ¬šŸ¬šŸ¬

Thilini Weerasinghe
5 min readJun 27, 2021

--

Image source: https://www.pinterest.com/

In the software development industry, container-based development is a common concept. But most of the developers havenā€™t a clear idea about that. Another thing is that some developers arenā€™t familiar with the word container and they are familiar with the word Docker. Docker is an open-source software product that enables developers to engage with container-based development and it is mainly handle by Docker inc. This article is going to explain what is container-based development, its advantages, usage and best practices etc.

Letā€™s start with little bit history of software development. In the early days, most of the software applications are deployed on a physical server. It means that it used separate physical hardware for everything that support software operations like application, database and web servers. The problemS associated with this deployment is users need to pay additional efforts to maintain that hardware, need spaces to store this hardware, need separated network, operating systems and other infrastructures and it is a high cost. Not only these things but also the important point is that it has a lot of waste of processing power. Because not any hardware boxes make use of its full processing powers or its memory. To overcome problems in this deployment method, next-generation is a hypervisor.

Types of Hypervisors. Image source: www.mycloudwiki.com

The above image represents two types of the hypervisor and the difference is that type 2 hypervisor has a host operating system in between hardware and hypervisor layer. You can see that applications are in the separated virtual machines and they shared same hardware via the hypervisor. Therefore it reduces memory and processing power wastage. But it also inherits some disadvantages. Maintaining separated operating systems is not an easy task. It needs additional licensing costs, wants to patch them, maintain them and update them. It increases the workload and it is a time-consuming process. Another thing is that scalability or adding an additional application to the system is a very complex task as it has to go through several sub-tasks. Other problems are the need to install multiple OS and starting a VM is not a seconds tasks as it wants to boot up. Though we find some solutions for the challenges in the first generation, it also has some problems and therefore we move to generation three which is known as container-based deployment.

What is container-based development??? šŸ¤”

Comparison between Hypervisor and Container-based deployments. Image source: https://www.altair.com/

See the above image clearly and then you can understand the difference between these two concepts. Unlike the hypervisor, it shared one operating system and there is a container engine on top of that and containers are on the container engine layer. By keeping shared OS, it solves several problems like licensing cost, additional maintenance cost and patching and upgrading issues as we need only to maintain a single OS. Donā€™t miss understand that containers are not equal to hypervisors. Containers are smaller than hypervisors. The main important thing is that for the containers we donā€™t need a separated OS and it gets used by the host OS which is already started. As getting advantage of that your applications can be started in few seconds.

Advantages of Containers šŸ‘

  • Increase the efficiency
  • Increase the portability
  • Reduce unnecessary maintenance costs
  • Reduces the developer overhead
  • Provide better application development

Industrial applications šŸ“

  • It provides DevOps support for the CI/CD method
  • Most of the companies refactor their old system to a container-based deployment
  • Some organizations use containers to migrate existing applications into more modern environments
  • Give better support for the microservice architectural development
  • Containers are being used to handle one or more similar operations, such as ETL functions or batch jobs, that operate in the background

Letā€™s talk a little bit about Dockerā€¦

šŸ¬ Docker šŸ¬

A cloud platform known as the dot cloud created that software project called Docker and now it is an open-source software project which is licensed under Apache 2.0. Though Docker Inc not owned by docker, they are the big community behind that project and it has mainly developed on Go programming language. Docker allows you to decouple your apps from your infrastructure, allowing you to swiftly release software. You can control your infrastructure the same way you control your apps with Docker. You may substantially shorten the time between developing code and executing it in production by leveraging Dockerā€™s methodology for shipping, testing, and deploying code rapidly.

Docker Engine

Docker Engine is a containerization platform that you may use to create and containerize your apps. Docker Engine is a client-server program that includes:

  • A server with a long-running daemon process dockerd
  • APIs which is specified interfaces that programs can use to talk to and instruct the Docker daemon.
  • A command-line interface (CLI) client docker

Registry, services, security features and orchestration are built around the docker engine. A registry is a place that responsible for storing the docker images. As a best practices software companies do not include their docker images in public repositories. Orchestration is a process that gets all the instances together can go for complete a common goal.

Another important thing about docker is it is a totally persistent software tool in nature. To go for container-based deployment it is better to have microservice level software development. In case of that, you can easily deploy a single service inside a single container. Therefore to get the best use of this deployment method your software architecture must fit with that.

OCI (Open Container Initiative)

Docker and the Rocket are the two software tool that handles by two companies and but shared the same initiatives. Therefore these two companies come up with mutual agreement called OCI and they are responsible to define the specifications for container-based deployment and govern it. In case that if you are deploying container-based projects all the containers should follow the OCI standards. The main thing is that containers should not lock into one platform or one vendor.

As a summary, we start from the evolution of the software deployment from physical server to container-based deployment. Keep in mind the following image and then you can get a clear understand of the difference among these deployment methods.

After that, we discussed in details the container-based deployment and its advantages as well as the application. The last section of the article, explains a little bit about the Docker, Docker Engine and OCI standards.

Stay Safe & Learn New Things!!! šŸ˜ƒ

--

--

Thilini Weerasinghe

Currently working as an Associate Software Engineer at Virtusa. Has completed degree in B.Sc (Hons) Computing & Information Systems. After all I am a Human...