Apr 30, 2021 @ Da Lat, Vietnam
This is a high-level note to myself focusing on why containerizing certain services makes sense. Although this article is meant for my future self, I hope that whoever reads this will find it useful.
Figure. "An Example of Containerized Architecture" by Chiayo Lin (2020)
I needed to deploy a Python service for an industrial visualization software at a company where I worked. The most effortless solution was to run the Python script directly on one of the company’s servers. However, such simple solution was not the result of some clever thinking but rather the absence of thoughts. After some research, I found that containerization is the more optimal and scalable way to deploy a service.
Having a TTY attached is not necessary for the service in question, since its primary mode of communication is not via standard I/O. The only necessary output is the logging, which can be redirected to a file or syslog socket. For that reason, we can simply daemonize the process. However, simply running the service on top of the OS is not optimal nor scalable. This is because dependencies and environment settings are not guaranteed to remain consistent across different servers, which can lead to unexpected behavior or errors.
Containers play a critical role in ensuring consistency and ease of deployment for services. By using containers, we can ensure that dependencies and environment settings remain consistent across all servers, which ultimately leads to reliable service performance regardless of the underlying server infrastructure.
In summary, containerization is a powerful approach to deploying services. It simplifies management, enhances scalability, and promotes consistency. I hope this note will be helpful anyone else who is looking to containerize their services.
© 2013-2023 chiayolin.org (repository )