Docker Software Architecture
Understanding Software Architecture
The software architecture of a system represents how the system itself behaves, as well depicts the organization and structure. The word “architecture” in software architecture may sound familiar.
Architecture is both the process and the product of planning, designing, and constructing buildings or other structures. — Wikipedia
So in order for a software to be built, it needs an architecture to lay the foundations. Besides defining structure and behavior, software architecture is also important to optimize program’s attributes such as security, performance, and manageability.
A well-laid software architecture also provides beneficial gains on the business side of things, such as the preparation of use-cases/scenarios, addressing requirements of various stakeholders, handling both functional and quality requirements, and improving the functionality offered by the system.
What Is Docker?
Docker is a tool for developers to create, deploy, and run their applications by using containers. It is open source, so it is free and easy to use. Docker wraps the application, including all the libraries and dependencies, into containers, so it could be easy to deploy it as one package. The container is then built into images and allows the developer team to share, as it makes the application easy to open on all kinds of devices that have an operating system.
Developers tend to use Docker for fast and consistent delivery of their application, allowing them to work in standardized environments using containers. Docker’s container-based platform allows for highly portable workloads, so the application contained in Docker can be run on any machine such as local laptops, cloud providers, physical/virtual machines, etc., with fewer resources.
What does Docker have to do with software architecture? Well, Docker is an example of a software architecture. It uses a client-server architecture.
Docker daemon is where the client “talks” to, i.e. building, running, and distributing the containers. Both the client and daemon can run on the same system, or can be connected remotely. The Docker registry finds and downloads the Docker images that are contained, based on the communication done by the Docker daemon and client.
Using Docker With Container Orchestration
Docker Orchestration, or can be referred as Container Orchestration, is about managing the lifecycle of the containers, especially in dynamic, large, continuous environments. Container Orchestration is used to automate the following tasks:
- Configuring the schedule of containers
- Allocating resources between containers
- Balancing the traffic routing of containers
- Securing the interactions between containers
- And more.
Orchestration tools for Docker includes: Docker Machine, which provides hosts and installs the Docker Engine itself, Docker Swarm, which is used to cluster multiple Docker hosts under a single host, and Docker Compose, that deploys multi-container applications by creating the containers.
Simple containerized applications actually do not need orchestration. But if the application is complex with a number of functionalities, that involves more than two containers, it’s best to use orchestration. Orchestrators also allow the developer to balance the load of the containers, as it determines the state of the system automatically.