What is a “Container” Anyway?

After reading a recent announcement by Google about enhancing Google App Engine to provide support for Docker, a popular containerization technology, I started wondering exactly what containers were and why they were taking the world of computing by storm.  The hallowed Container is being touted as the next king of the virtualization world, getting ready to displace the mighty virtual machine (VM).

downloadContainers are basically light-weight VMs that provide VM like functionality with some constraints and conditions, but do so in a manner that is more efficient than a VM.  A traditional VM is supported by a hypervisor, which is basically a software layer that abstracts the full underlying physical hardware, a key reason why the traditional VM infrastructure is resource intensive.  The result is that it is possible to run only so many VMs at a given time on a hardware platform with finite resources (such as CPU and memory).  Where containers prove to be clever is that they are supported by a container engine that abstracts only bits and pieces of the underlying platform, relying on the operating system for other required functionality.  This is a double-edge sword however: the simplicity and light weight nature of containers does indeed mean that many more containers (and therefore application workloads) can be run on a piece of hardware than can traditional VMs, however, since there is tight coupling between the container and the native operating system, all containers running on a given hardware are forced to share the same operating system, with the result that containers do not allow operating system multiplicity i.e. it is not possible to run application workloads on different operating systems on the same physical platform.

Containers in computing are not unlike the containers in the physical shipping and transportation world.  Before containers arrived on the scene, transportation and trade of goods was handled manually, where  longshormen handled break bulk cargo in and out of the ship’s hold, playing a game of maritime Tetris.  The manual nature of loading and packing severely limited efficiencies and speed of transportation and trade.  This situation of yore is akin to developing, deploying and managing applications in a purely physical environment, where application code developed had to be painstakingly tested for functionality and performance on a raft of major platforms and their operating system variants.  To be clear, trade and transportation was not all manual before standard shipping containers came on the scene: containerization had begun in bits and pieces as early as the 1800s.  This containerization was however heavily fragmented, with each trading company devising its own practices, standards, and supporting infrastructure for loading, unloading and securing the containers.  This containerization enabled them to achieve efficiencies for the specific types of cargo and the specific modes (rail, road, or sea) they dealt with.  This efficiency however came at a cost: the cost of having to maintain and manage their own infrastructure, practices and standards for loading/unloading, packing/unpacking, and transporting.  This is not unlike the situation we have today with VMs where although there is flexibility of running workloads in different operating systems, there is the overhead of managing all the supporting infrastructure to enable that flexibility.

With the emergence of containers (the  computing kind), we are moving into the realm of standardization, as the container of the physical world did when Malcolm McLean, the American trucking magnate, devised his revolutionary intermodal shipping container, which standardized the shipping container industry on a common set of standards, practices and intermodal transfer and handling of goods.  Companies such as Docker are trying to do what Malcolm McLean did: standardize and streamline the way workloads can be encapsulated, ported and run on a set of commonly used operating systems.  Malcolm McLean’s intermodal container transformed the shipping industry.  It is yet to be seen if the likes of Docker can replicate success to that scale in the computing world.