In my conversations with partners and customers about scaling cloud services and applications, the topic of containerization always comes up. A container is an isolated place where an application can run without affecting the rest of the system, and without the system affecting the application. Docker is the containerization software that most people are familiar with, but there is still often a lack of understanding about what containerization is and how it can be used by an organization. This month's Application Development Partner Community topic is containers.
All organizations use some form of virtualization in their business. Virtualization is a form of containerization, virtual machines are isolated and run on a host operating system. Each virtual machine (VM) contains the files necessary to run the operating system and the application on it. Virtual machines are portable and can be migrated from host to host, provided they are running compatible host operating systems. A similar principle applies to application virtualization - the applications are contained and isolated from the host's operating system. Each container includes the application components, files, environmental variables, and libraries necessary to run the application the container hosts. Containers, like virtual machines, are portable to compatible operating systems.
When a virtual machine is deployed to run an application, the guest operating system is deployed and configured. The application variables must then be deployed. While this can be automated, it is an additional step that is not necessary in the deployment of containers. The image below visualizes the deployment of an application on virtual machines and a deployment with containers. While this graphic from Docker is not to scale, it does demonstrate the additional layer that is necessary to deploy and manage when using virtual machines.
An important distinction between VMs and containers this visualization outlines is that containers run on the host operating system, but they can also run on virtualized host environments. Running containers on a virtual machine would add an additional layer to manage, but doing so provides options for organizations that want to implement containers on already virtualized environments. Virtual machines don't work well in a double inception situation of a virtual machine inside of a virtual machine.
Microservices and containers
With the emergence of container architecture, it is important to have a discussion about microservices. Microservices mark a shift in application architecture by breaking up a larger application into small independent services. One advantage to this deployment model is that the entire application can be tuned at a much more targeted level. If one part of these microservices is experiencing high load it can be scaled independently of the entire application. A recent report from Gartner identifies containers as ideal tools for applications that require agile development and scaling, (Agile Infrastructures Will Need to Support Containers, 2015)
"Containers are ideal tools for those applications that require agile development and change, horizontal composability (with loosely coupled microservices), and horizontal scalability." – Gartner Analysts, Thomas Bittman and Dennis Smith
Modern applications are faced with access across multiple clients, access via APIs, and integration to other applications. Microservices create a layered approach to respond to this challenge and containers are a natural host for microservices. A good source of information about microservices is published here.
The most well-known container environment is Docker. There are other container environments like Rocket, LXC, and OpenVZ, but Docker is the one that many major hosting providers are working with. While Docker is a container system at its core, they have also developed a host of tools that make registration, deployment, management, and scaling of Docker containers easier. Docker is not a replacement for tools like Chef or Puppet, but works in conjunction with them.
Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.
Microsoft Azure has support for Docker containers on Linux VMs, and you have the flexibility to deploy Docker in a few different ways, depending on your needs. And, we have brought Docker to Windows Server.
Benefits of containers
Containers are being used by some of the most popular applications and websites today, such as BBC News, Uber, and BleacherReport. Container architecture allows for rapid environmental scaling. When new developers begin working on an application, containers enable them to deploy to their development environment without the need to spend hours configuring. Containers also provide deployment consistency across development, testing, and production environments. Combine this consistency with a microservices architecture, and applications can be tuned and scaled precisely.
Getting started with containers is easy. If you don't want to work on your own machine, spin up a VM on Azure and check it out in minutes (you can sign up for a free account or use your MPN internal use rights benefit if your company has a competency or Action Pack subscription). Docker can be deployed in minutes on Azure from the Marketplace as a blank environment or you can deploy a pre-created container on top of it with mysql, WordPress, redis, and more.
Application Development Partner Community
- Sign up for the November 1 community call about containers
- Community call schedule
- Yammer group
- Blog series
- Training and enablement