Docker: the Game-Changing Player in Web Development

It is hard to believe the impact of open-source technologies: Docker was first released in 2013 and has gradually become the choice of virtualization of many web projects. How is Docker different? What makes Docker a game-changing player?

Virtualization and containerization are no more nerd-only topics but well-understood by developers, managers and HR people. Virtual environments, especially containers, provide isolated execution contexts that coexist on a same physical machine (or virtual machine).

The essence of container technology has been evolving since Unix kernel developments in 1979, although referred to differently as “chroot,” “jail,” “microservice,” etc. In 2008, the technology evolved into the solution of LXC, Linux Containers, allowing the running of multiple isolated Linux systems on a Linux host.

Docker was in the beginning based on LXC before 2014, but quickly developed and open-sourced its own solution “libcontainer” for cross-platform abstraction. This abstraction sparked the rise of container industry.

As a layer above operating system, this abstraction have both pros and cons, but there are far more pros in the context of web development, a task that is complexity-bound but not resource-stringent.

Apart from its obvious advantage, the effective isolation with near-bare metal performance, Docker has three other advantages that are important in the context of web development.

Docker forces to think/design in processes.

Web developers do not always have computer science backgrounds, and frontend development is most of the time regarding the “scripting” of a single thread (JavaScript). When working with backend, the simple parallelization of web server instances can bring in lots of headache with resource management and race conditions if the backend is not properly programmed.

The requirement that a Docker container can only run a single process at a time seems a hard restriction, but in fact forces developers to think about the parts of the system – including the hidden ones: database, memory cache, reverse proxy, etc. Using Docker, each of them needs a container, unlike a virtual machine installed with all of them.

This requires web developers to explicitly work through all the interconnections between processes or containers. While figuring out the shared resources and interdependencies, there are more chances that a race condition can be eliminated from the design of the web system.

With Docker, it is possible to develop as we deploy, and deploy as we develop.

Docker containers are stateless and portable. There is no surprising difference between development and deployment environments. When it’s time to deploy, simply build the containers and kick them off as usual. Docker Engine handles all the reinstantiation and continuity when system restarts or a service unexpectedly halts.

The great tool Docker Compose, initially released in late 2013 and gradually matured in next years, is a necessary add-on for web development because we are always in need of multiple containers. Docker Compose simplifies all this for us, and ensures the setup of containers stays exactly the same from development to deployment.

With Docker, the logs of an application are naturally centralized.

Logging is often a neglected issue in web development and also is difficult to be done correct. Logs are often found and cross-compared in different places, and if unconfigured, a log file may contain multiple applications simultaneously.

With Docker, we may boldly use standard output for logging purposes in every circumstance because Docker Engine keeps track of them under the hood. With Docker Compose, the logs of multiple parts of an application can be extracted in the same screen for easier debugging on timeline. The logging is thus naturally centralized on application logic.


Studio theYANG has been extensively working with both Docker and LXC, the two most popular container technologies available on Linux, and has further contributed to the development of open-source LXC container management tool LXDock. With the experiences from both sides, we think Docker has done the better abstraction for most applications, although it presents a steeper learning curve than LXC-based solutions. If you have any virtualization needs, we will be willing to help out with our experiences and understanding.

Published by

Ling YANG

Lead consultant at Studio theYANG, an independent web software consulting studio from Montreal, Canada focused on maintenance and support of Python and Linux systems.

Leave a comment