Fotolia

What are containers and microservices?

Independently deployable bits of code can be used to build agile applications. We look at some of the main players

Containers encapsulate discrete components of application logic provisioned only with the minimal resources needed to do their job.

Unlike virtual machines (VM), containers have no need for embedded operating systems (OS); calls are made for OS resources via an application programming interface (API).

Containerisation is, in effect, OS-level virtualisation (as opposed to VMs, which run on hypervisors, each with a full embedded OS).

Containers are easily packaged, lightweight and designed to run anywhere. Multiple containers can be deployed in a single VM.

A microservice is an application with a single function, such as routing network traffic, making an online payment or analysing a medical result.

The concept is not new; it has evolved from web services, and stringing microservices together into functional applications is an evolution of the service-oriented architecture (SOA), which was all the rage a few years ago.

Not the same thing

Containers and microservices are not the same thing. A microservice may run in a container, but it could also run as a fully provisioned VM. A container need not be used for a microservice. However, containers are a good way to develop and deploy microservices, and the tools and platforms for running containers are a good way to manage microservice-based applications. In many cases, the terms can be interchanged.

Containers have been integral to Unix and Linux for years. A recent change has been the ease with which they can be used by all developers, and an entire supporting ecosystem has grown up around them. Containerisation is not something happening on the fringes of IT, it is core to the way many web-scale services operate and is increasingly being adopted by more conservative organisations. The suppliers mentioned in this article cite customers ranging from the NHS to large banks.

There are many suppliers involved, but no one disputes that Docker has led the charge and sits at the heart of the market. Docker says millions of developers and tens of thousands of organisations are now using its technology. However, another statistic indicates the novelty of containerisation for many, with only 40% of Docker’s customers running containers in production.

Docker’s dominance does not mean it holds a monopoly; far from it. Across the whole container ecosystem, there is plenty of choice. There are many startups and the great and good of the IT industry are all on board, as a glance at the sponsors of the February 2016 Container World event shows. The top sponsor is IBM, which is one of Docker’s three main global go-to market partners, along with Microsoft and Amazon Web Services (AWS).

Open source componentisation

Multiple containers are deployed in clusters and managed using a range of tools. Many of these containers will be pre-built components that can be layered together to build up application images. A prime benefit is that it is easy to “overwrite” an individual container while the application is still running – less scheduled downtime means better business continuity.

This has led to the rise of the DevOps concept, which allows faster deployment of new software capabilities directly into an operating environment.

Much of the core containerisation technology is open source, and suppliers that have previously eschewed it, such as VMware, are being drawn in. At its heart is the Open Container Initiative (OCI) launched in 2015. This operates under the auspices of the Linux Foundation to create open industry standards around container formats and their runtime environment. Docker has donated its own format and runtime to the OCI to serve as the cornerstone.

Many containerised components are downloadable from open collaboration projects such as GitHub and Docker Hub. As with all open source technologies, the suppliers that operate in the market must earn their money by providing stable versions with associated support services.

Containerisation platforms

All the big industry players are joining the containerisation bandwagon, with a range of initiatives under way.

Google is an old hand with containers – it has been developing and deploying billions internally for years. The company has been a major contributor to various container-related open source projects, included the Kubernetes orchestrator, which it donated.

Google has now opened up this expertise to its customers and added the Google Container Engine to the Google Cloud Platform.

Microsoft has added container support with Windows Server Containers enabling the sharing of the OS kernel between a host and the containers it runs. Hyper-V Containers expands on this by running each container in an optimised virtual machine. For the cloud, there is the Azure Container Service (ACS), developed in conjunction with Docker, which can manage clusters of containers with “master machines” for orchestration. ACS also supports other orchestration tools, such as Kubernetes.

AWS customers were quick off the mark to deploy containers on its EC2 platform, so AWS has followed up by providing a cluster management and scheduling engine for Docker called the EC2 Container Service (ECS). This is supported by the EC2 Container Registry (ECR) to support the storing, management and deployment of container images. ECS is widely available, whereas ECR is currently available only in the eastern US.

VMware has not taken the move to containers lying down. Later this year, it will release vSphere Integrated Containers, using VMware’s Photon OS to turn VMs into Docker-like containers based on OCI. This will allow users to take advantage of existing vSphere support tools. In a first for VMware, it has open-sourced both the PhotonOS and the associated Photon Controller.

Other examples include IBM Containers for Bluemix, Rackspace Carina (based on OpenStack Magnum, embedded support for containers and orchestration). Another open source initiative is Deis, a platform-as-a-service (PaaS) based on CoreOS.

Big decisions

For developers, the open source nature of the container marketplace makes it easy to access the technology and supporting tools and crack on with building agile applications through a DevOps-style process.

This offers many benefits to businesses, but they must consider the supporting platforms and technologies that are endorsed to ensure longer-term stability and support. Making such decisions will not be easy as the containerisation market changes.

Bob Tarzey is analyst and director at Quocirca.

Next Steps

Master containerized microservices monitoring

Read more on Software development tools