TheNewStack Book2 Applications and Microservices With Docker and Containers
TheNewStack Book2 Applications and Microservices With Docker and Containers
vol.
APPLICATIONS
& MICROSERVICES
WITH
DOCKER
& CONTAINERS
EDITED & CURATED BY ALEX WILLIAMS
TABLE OF CONTENTS
Introduction .................................................................................................................................. 4
Sponsors ........................................................................................................................................ 6
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
INTRODUCTION
As an architectural pattern, microservices have been getting a lot of
attention in the last several years, reaching a level of adoption and
evangelism that would be hard for most practitioners to ignore. But while
microservices architectures have received wide praise as changing the
application development and production process on the whole, there are
name for service-oriented architecture (SOA). Its important to explore
both the drivers that shaped how microservices evolved into the pattern
we know today, and also to understand what tools and services have
made its current popularity so widely accessible.
In this ebook, The New Stack explores the ways that container-based
microservices have impacted application development and delivery. We
learn about what containers mean to the process of creating and utilizing
microservices. Through that lens, we look at how container technology
has become so important in implementing the pattern of microservices.
Within this ebook, we explore what makes up a microservices architecture,
as well as some processes around migrating monolithic applications to
microservices. We also provide case studies for containers in production.
There is also a great deal of original research weve performed about the
open source container ecosystem that we are eager to share with our
broader community; this series focus on open source communities is a
continuing topic that we are looking to expand upon, and we welcome
feedback on what weve done so far.
INTRODUCTION
SPONSORS
We are grateful for the support of the following ebook series sponsors:
FROM MONOLITH TO
MICROSERVICES
by VIVEK JUNEJA
systems codebase before they can even begin to work on it. Even the
most knowledgeable of development teams is fearful of making changes
or adding new code that would disrupt operation in some unforeseen
way, so the most mundane of changes is discussed ad nauseum.
When things go wrong, operations blames development and development
blames QA. Project managers blame the budget and everyone else. The
replace the internal team.
Unless youve been living under a rock, youve heard of how microservices
can turn this scenario on its head, enabling a new, more agile world in
which developers and operations teams work hand in hand to deliver
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
Adopting Microservices
One common approach for teams adopting microservices is to identify
existing functionality in the monolithic system that is both non-critical
and fairly loosely coupled with the rest of the application. For example, in
for a microservices proof-of-concept. Alternately, more sophisticated
teams can simply mandate that all new functionality must be developed
as a microservice.
In each of these scenarios, the key challenge is to design and develop the
integration between the existing system and the new microservices. When
a part of the system is redesigned using microservices, a common
practice is to introduce glue code to help it to talk to the new services.
An API gateway can help combine many individual service calls into one
coarse-grained service, and in so doing reduce the cost of integrating with
the monolithic system.
The main idea is to slowly replace functionality in the system with discrete
microservices, while minimizing the changes that must be added to the
system itself to support this transition. This is important in order to reduce
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
the cost of maintaining the system and minimize the impact of the
migration.
Maximum scalability
Monolithic system
http://microservices.io/articles/scalecube.html
FIG 1: Illustrating Martin Abbott and Michael Fishers scale cube method of scaling
bounded context pattern to identify cohesive feature sets which did not
couple with the rest of domain.
One challenge faced by teams new to microservices is dealing with
distributed transactions spanning multiple independent services. In a
monolith this is easy, since state changes are typically persisted to a
common data model shared by all parts of the application. This is not the
case, however, with microservices. Having each microservice managing its
own state and data introduces architectural and operational complexity
when handling distributed transactions. Good design practices, such as
domain-driven design, help mitigate some of this complexity by inherently
limiting shared state.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
10
11
1. Functional Decomposition
Y-Axis Scaling
2. Data Partitioning
Z-Axis Scaling
Monolith
Microservices
h t t p : / / m a r t i n fo w l e r. c o m / a r t i c l e s / m i c ro s e r v i c e s. h t m l
12
Service Size
Service size is a widely debated and confusing topic in the microservices
community. The overarching goal when determining the right size for a
microservice is to not make a monolith out of it.
The Single Responsibility Principle is a driving force when considering
the right service size in a microservices system. Some practitioners
advocate as small a service size as possible for independent operation
and testing. Building microservices in the spirit of Unix utilities also leads
to small codebases which are easy to maintain and upgrade.
Architects must be particularly careful in architecting large domains, like
products in an e-commerce system, as these are potential monoliths,
of products, for example. For each type of product, there could be
Encapsulating all this can become overwhelming, but the way to
approach it is to put more boundaries inside the product domain and
create further services.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
13
Testing
Lets look at some operational aspects of having the monolithic system
progressively transformed into a microservices-based system. Testability
is a common issue: during the course of developing the microservices,
teams will need to perform integration testing of the services with the
monolithic system. The idea, of course, is to ensure that the business
operations spanning the pre-existing monolithic system and the new
microservices do not fail.
One option here is to have the system provide some consumer-driven
contracts that can be translated into test cases for the new
microservices. This approach helps ensure that the microservice always
has access to the expectations of the system in the form of automated
tests. The systems developers would provide a spec containing sample
to create relevant mocks, and as the basis for an automated test suite
that is run before integrating the new microservices with the existing
system. Pact, a consumer-driven contract testing library, is a good
reference for this approach.
Creating a reusable test environment that can deploy a test copy of the
for those teams and improves the feedback loop for the project as a
whole. A common way of accomplishing this is to containerize the entire
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
14
Service Discovery
A service may need to know about other services when accomplishing a
business function. A service discovery system enables this, wherein each
service refers to an external registry holding the endpoints of the other
services. This can be implemented through environment variables when
dealing with a small number of services; etcd, Consul and Apache
ZooKeeper are examples of more sophisticated systems commonly used
for service discovery.
Deployment
Each microservice should be self-deployable, either on a runtime
container or by embedding a container in itself. For example, a JVM-based
microservice could embed a Tomcat container in itself, reducing the need
for a standalone web application server.
At any point in time, there could be a number of microservices of the
same type (i.e., X-axis scaling as per the scale cube) to allow for more
15
Feature Flags
One other common pattern is to allow for
us to trigger the use of the relevant microservice for the feature when the
16
17
Organizational Considerations
The most challenging aspects of moving from monoliths to microservices
18
Conclusion
Most of the ideas shared in this article have either been practiced or have
delivered results in organizations of all sizes. However, this is not a
evolving patterns and adoption war stories. As more organizations move
from monolithic systems to microservices, we will have more to learn
along our journey.
19
THE TEN
COMMANDMENTS OF
MICROSERVICES
by JANAKIRAM MSV
multitier architecture with .NET and Enterprise JavaBeans (EJB), and more
recently, web-scale computing.
Microservices 101
With Infrastructure as a Service (IaaS), it is fascinating to implement the
concept of scale-out and elasticity on cloud platforms. DevOps can create
dependencies and code. As long as the application servers and web
servers are stateless, they can scale from a handful of instances to a few
either get launched or terminated without much intervention.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
20
A collection of independent,
autonomous containers participating
microservices architecture.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
21
22
23
assumptions can be made about the host on which the service would run.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
24
Each service can be launched on any available host in the cluster that
from virtual machines. While a virtual machine may run the whole stack, a
container owns a subset of the stack. For example, when refactoring a
LAMP web application for microservices, the web tier with Apache runs in
a dedicated container while MySQL moves to another container.
25
response mechanism. Its common for microservices to expose wellknown HTTP endpoints that can be invoked through REST API calls.
While HTTP and REST are preferred for synchronous communication, its
becoming increasingly popular to use asynchronous communication
between microservices. Many consider the Advanced Message Queuing
Protocol (AMQP) standard as the preferred protocol, in this regard.
Developing microservices with an asynchronous communication model,
while sometimes a little more complex, can have great advantages in
terms of minimizing latency and enabling event-driven interactions with
applications.
In the market today, RabbitMQ and Apache Kafka are both commonly
used message bus technologies for asynchronous communication
between microservices. Also, if the message-passing is done on the same
host, then the containers can communicate with each other by way of
system calls, as they all share the same kernel.
Exit Point
In most cases, microservices are treated like a black box, with less visibility
into the actual implementation. With inconsistent entry points and exit
points, it will be a nightmare to develop a composed application.
26
27
If rules and constraints are not considered by the SysOps team, services
may need to raise alerts or log appropriate messages warning about
microservice may have to shut down if the mandatory rule is not
respected at deployment.
28
Conclusion
older models and patterns. As mentioned before, microservices
architecture has its roots in models like COM, COBRA, EJB and SOA, but
there are still some rules to live by when creating microservices utilizing
current technologies. While the ten best practices weve laid out here are
not entirely comprehensive, they are core strategies for creating,
migrating and managing microservices.
29
HOW MICROSERVICES
HAVE CHANGED
AND WHY THEY MATTER
by ALEX WILLIAMS
30
For example, monitoring is more critical than ever for companies dealing
with a growing scope of services and stacks. To solve problems,
across potentially ephemeral nodes and across multiple services. This
need to have granular monitoring and better tooling helps practitioners
of microservices that the application depends upon.
So what works? It starts with the organization and the API: A
microservices-based product team and a separate backend-based
platform team with an API between them, where the API calls are made
and the infrastructure responds consistently and accordingly.
Microservices
architecture with bounded context. It allows updates without needing to
understand how everything else works.
Services are built across organizations, and ownership stays in one place.
Microservices architecture serves more as point-to-point calls between
versions, everything still works. That means when building a microservices
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
31
32
Bluemix Garage Method. The IBM Bluemix Garage Method combines the
reliability and testability of enterprise solutions with the latest open
repeatable, creating continuous delivery pipelines, and deployment on
cloud platforms. Its a valuable, open resource for anyone to improve their
DevOps skills for individuals, teams and entire organizations, all with
governance-compliant management and monitoring abilities.
33
manifest provides the details about the resources needed, the volume
contract. It tells the developer and the operations professional what to
expect. Its not this medieval style of developer and operations
relationship that forces the developer to throw the code over the wall.
A manifest may contain metadata about an application, plus descriptive
This may be an instance, a pod manifest, a replication controller or a
34
35
Today, the complexity comes with moving from VMs and monoliths to
containers and microservices. Companies struggle with how to make the
infrastructure and the overall organization itself.
The objective of Joyents open source Triton solution is to simplify and
accelerate a companys transition to containers and microservices,
Cantrill said. It allows developers to simplify architectures. You provision
only containers and never provision a virtual machine. You are able to take
the cookbook for microservices and deploy it in seconds, because you
Cantrill said Joyent is a fan of Docker Compose, as it can talk to a single
a full, resilient operating service. This is the big trend, Cantrill said. How
do we uplevel thinking from containers to services?
Kit Colbert, looks at the market from a
perspective of how to move along the container journey. VMware has
been focused on the operations space. It is now developing an approach
to meet the new emergence of developers and their needs, but as an
infrastructure provider.
For VMware, the company sees itself as an infrastructure provider, not an
application-centric, architecturally-oriented company. Colbert sees
customers interested in Cloud Foundry, but others that want a DIY
approach. VMware is seeking to support application technologies with
vSphere Integrated Containers (VIC) and Photon platform.
36
37
the way the developer works. Developers do not work in the same manner
38
systems and such. It allows the customer to put the complexity at the top
for the end-user.
are adding up to big changes in the enterprise, both on the technical and
cultural levels.
39
CREATING STANDARDS
FOR THE CONTAINER
ECOSYSTEM
This discussion with Josh Ellithorpe at DockerCon
EU in Barcelona revolves around standardization
within the Docker and container ecosystem, with
a focus on the importance of compatibility with
standardized image formats. Making containers and tooling work
for the entire ecosystem is only possible by controlling
environments and standards, and youll hear more about the
Listen on SoundCloud or Listen on YouTube
Josh Ellithorpe
native who began his career in the late nineties working in all aspects
open source project, Throttled Pro, in 2001. Specializing in Ruby development,
Josh decided to acquaint himself with San Franciscos tech scene, and made
emerging social applications for companies like Facebook and Involver. Hes
now joined Apcera to revisit his networking roots and revolutionize the cloud.
40
CONTAINERS IN
PRODUCTION, PART I:
CASE STUDIES
by MARK BOYD
41
streaming even if, say, a developer introduces a bug into the album cover
art feature, or one of its more than 5,000 production servers in its four
To accomplish this, the company packages each discrete feature of Spotify
as a microservice. Containers are then used to allow Spotify to bundle
all the relevant information and display it in the interface that an end user
added, or more users are simultaneously asking for their own app services
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
42
43
are not Hulu, but if you watch a Korean drama on Hulu, they are streaming
content they licensed from DramaFever.
During her work at DramaFever, Kromhout took a cattle, not pets
containerized to enable autoscaling up and down. DramaFever started
using Docker in production in October 2013, at version 0.6. Using Docker
enforces consistent development and repeatable deployment; containers
the same, even as they move code from their laptops through to the
cloud-based QA, staging and production environments. The code in the
containers can be trusted every time the architecture autoscales a new
instance of the application or microservices components, as it is going to
have the same operational context as any testing or development
arrangement.
44
45
Patel says that for the most part, the majority of IaaS and BaaS customers
are really looking for a database-as-a-service solution with out-of-the-box
authentication and similar features which enable the database to be
provided to end customers as an application. But 20% of their customers
wrapped around the database. Built.ios customers need to be able to
write the custom logic and have it added to built.ios servers.
We didnt want it to get too complicated for our customers to have to set
up their own server, etc. So we wanted an easy way to let our customers
upload their custom code and run it alongside their database. So,
essentially, we wanted a container in the cloud, says Patel.
That led built.ios Mumbai-based engineering team to look at available
options and two years ago, one of their engineers came across Docker
concept and set up these containers, uploaded code and you know what,
we were pretty impressed with what it provided. It was a secure container
that didnt mess with anyone elses code. So then we went a step further
and looked at writing our own management layer.
Patel estimates that built.ios customers spin up thousands of containers
at any given time, as each customers account by default comes with a
Docker container.
It gave us a competitive advantage to go with containers. Our
46
our MBaaS with Docker in production, you can upload full node.js
applications, for example.
Like Spotify and DramaFever, Built.io found existing tools lacking, given
the early adoption nature of their containers-in-production environments.
This led to Built.io choosing to build their own management layer in the
same way that Spotify built their own orchestration service and how
DramaFever built a horizontally scalable host-local Docker registry
architecture.
What we wanted was the ability through APIs is to make an API call to set
higher paid customers to be able to set up bigger containers. We wanted
customers to be able to have a load balancer container, we wanted to add
additional security provisions, and enable through the API to manage
starting and stopping containers, and using an API to get container logs
and put it into our customer management UI.
Patel says built.io continues to keep an eye on the container ecosystem
for other tools that could take over the management layer for them, and
while Deis comes close, for now they have decided to continue doing this
themselves.
47
48
The team has two servers. One runs MaestroNG and is responsible for
starting stock Docker containers. The other runs a virtual machine running
Jenkins. We use it as a kind of robot that performs repetitive work, he
says. We programmed Jenkins so that when we push a new change to
any of the projects, Jenkins detects the new change, rebuilds the whole
image, adds the code to the new image, then orders MaestroNG to pull the
Elizondo used the DigitalOcean platform to test the new architecture and
about a month and a half to test it and work out all the kinks.
The biggest discovery in our experiment was that in our containers and in
works for Node.js applications. I also tested it with our Ruby application.
49
up shelving their plans for a Docker-based production use case due to the
complexity inherent in orchestration. With the maturing Kubernetes
platform now able to manage orchestration of Docker containers,
however, Zulily has been able to return to their production goals.
Kubernetes is production ready, even for a deployment like ours at Zulily
where were not talking about hundreds of nodes, Reed now says.
Conclusion
At the start of 2015, using containers in production was seen as either an
experiment or a bold choice for enterprise. Now, only twelve months later,
projects, but are being woven into the architectural fabric of an enterprise.
50
MICROSERVICES
FRAMEWORKS FOR
HANDLING COMPLEXITY
AT SCALE
In this interview, Ken Owens discusses the role of
microservices in developer and operations teams,
and how practices are emerging around
microservices, scheduling, and service discovery
these practices, and the tools theyre using. Ken talks about solving
some of these complexities with Mantl, which serves to help
DevOps teams working with both enterprise and small-scale
applications. Listen on Sound Cloud or Listen on YouTube
Ken Owens
business. He brings a compelling view of technology trends in enterprise IT
51
52
the projects covered. Yet, due to the most active participants, the average number of
total contributions is 53.
31
PROJECTS
HIGHLIGHTED
83
PROJECTS
IN ONGOING STUDY
1,127
COMPANIES
HIGHLIGHTED
1,454
COMPANIES
IN ONGOING STUDY
2,800
CONTRIBUTORS
HIGHLIGHTED
3,910
CONTRIBUTORS
IN ONGOING STUDY
135,636
CONTRIBUTIONS
HIGHLIGHTED
207,378
CONTRIBUTIONS
IN ONGOING STUDY
53
54
Pony Factor
as the Pony Factor
contributors whose total number of contributions constitute the
majority of the codebase. A project with a low Pony Factor gets most of its
contributions from just a few people, whereas a project with a high Pony
Factor has a larger number of contributors.
Elephant Factor
The second measure of diversity has been termed the Elephant Factor
by open source, community metrics company Bitergia. For each project,
companies whose total contributions
from their employees constitutes the majority of the contributions. A
project with a low Elephant Factor gets most of its contributions from just
a few companies, whereas a project with a high Elephant Factor has a
larger number of companies contributing to the codebase.
Whale Factor
something that we will henceforth call the Whale Factor. For each project,
companies whose employees constitute a
majority of the projects contributors. A project with a low Whale Factor
gets most of its contributors from just a few companies; whereas a project
with a high Whale Factor gets more of its contributors from a larger
number of companies.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
55
Pony Factor
Elephant Factor
Whale Factor
# of contributors whose
combined contributions
constitute a majority
# of companies whose
combined contributions
constitute a majority
# of companies whose
combined contributors
constitute a majority
appc Spec
11
Aurora
Brooklyn
Chronos
21
23
Crate
Deis
51
Docker
88
56
Pony Factor
Elephant Factor
Whale Factor
# of contributors whose
combined contributions
constitute a majority
# of companies whose
combined contributions
constitute a majority
# of companies whose
combined contributors
constitute a majority
etcd
30
Flannel
Fleet
Flocker
Kubernetes
12
33
LXD
12
Mantl.io
12
Marathon
40
Mesos
25
OpenStack Magnum
10
Pachyderm
Packer
141
Photon
Powerstrip
Rancher
rkt
19
runC
15
57
Pony Factor
Elephant Factor
Whale Factor
# of contributors whose
combined contributions
constitute a majority
# of companies whose
combined contributions
constitute a majority
# of companies whose
combined contributors
constitute a majority
Serviced
Tsuru
Vagrant
163
Weave
FIG 2: Although projects usually get most of their contributions from employees of
We encourage readers to view the public data set. Feel free to leave
comments and utilize the data weve collected. Our primary goal in
creating the Whale Factor, and referring to the three factors together as
the Animal Factor Index, is to inspire others to pursue additional lines of
research and investigation.
58
information as follows: The New Stack used company domain names that
contributors provided Gmail addresses or no email address at all, we used
other means to identify their employers name and username across
several social networks and databases. Clearbit and FullContact APIs
were also used to collect information.
Blockspring, for instance, has an algorithm that cross-checks a persons
email address. While none of these methods are perfect, they were
accurate a vast majority of the time. For those people that still did not
have company information, every personal website that was provided was
reviewed. Additionally, if a real username was provided, a search for the
and other information was similar to what was included on their GitHub
contributors, which account for 93 percent of contributions.
GitHubs own dashboards, because of how we counted contributions from
merged repositories and those handled by bots.
The Contributors
The heart and soul of open source is its people. Believers in the great
man view of history will want to start by looking at a projects
contributors. No credible discussion of Linux can avoid Linus Torvalds and
no analysis of container-based open source projects can ignore Solomon
Hykes. As the heart and soul of a project, core contributors are a reason
projects succeed or fail.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
59
Using data pulled from GitHub, we can track the number of commits and
lines of code submitted, yet tracking those raw numbers fails to measure
how important those contributions are. The context of these contributions,
along with the dynamics of ticket resolution, can show how healthy
relationships are within the community.
to look at their relationships with other developers, place of employment
contributed to the greatest number of projects among the 83 projects
being investigated (see Figure 2), but it is beyond the scope of this chapter
to do a comprehensive social network analysis. Unseen in the table
projects. Reasons why they are involved in the same projects include
have already established a good working relationship.
# of
Contributions
/docker/docker
/opencontainers/specs
/coreos/rkt
/coreos/etcd
/apache/aurora
/opencontainers/specs
/appc/spec
/kubernetes/kubernetes
/docker/docker
/opencontainers/runc
CoreOS
/coreos/etcd
/coreos/rkt
/kubernetes/kubernetes
/opencontainers/runc
915
/docker/swarm
/kubernetes/kubernetes
/docker/docker
2019
/docker/swarm
/opencontainers/specs
2488
/appc/spec
1941
60
# of
Contributions
Jessie Frazelle
(7)
Docker
/docker/docker
/docker/notary
/opencontainers/runc
/docker/docker-benchsecurity
/docker/compose
Michael Crosby
(6)
Docker
/docker/docker
/opencontainers/runc
/opencontainers/specs
/docker/docker-benchsecurity
/mesosphere/marathon
Sven Dowideit
(6)
Docker
/docker/docker
/docker/machine
/docker/swarm
/kitematic/kitematic
/docker/compose
/opencontainers/runc
Victor Vieux
(5)
Docker
/docker/docker
/docker/swarm
/opencontainers/runc
Alexander
Morozov
(5)
Docker
Tianon Gravi
(5)
InfoSiftr
Francisco Souza
(4)
/docker/machine
900
2261
700
2123
/docker/docker
/opencontainers/runc
/opencontainers/specs
918
/docker/docker
/docker/boot2docker
/opencontainers/runc
/docker/swarm
/docker/machine
/tsuru/tsuru
/docker/docker
/kubernetes/kubernetes
pachyderm/pachyderm
4714
/opencontainers/runc
1500
847
Solomon Hykes
(4)
Docker
/docker/docker
/docker/swarm
Evan Hazlett
(4)
Docker
/docker/machine
/shipyard/shipyard
/docker/docker
/docker/boot2docker
1479
Victor Marmol
(4)
/kubernetes/kubernetes
/opencontainers/runc
/docker/docker
1288
Matthew Fisher
(4)
Yard
/deis/deis
/docker/swarm
Clayton
Coleman
(4)
Red Hat
/kubernetes/kubernetes
Lewis Marshall
(4)
UK Home
1222
/docker/swarm
/docker/docker
/opencontainers/runc
1213
914
FIG 3: Jonathan Rudenberg, Lewis Marshall and Matthew Fisher worked together on
61
The Companies
Just because most of the work and contributions come from just a few
companies does not mean the project is closed source. Technically, that is
projects in this space use the Apache License, Version 2. As we discussed
in How Open Source Communities Power Docker and the
Container Ecosystem and Developing a Methodology for
Analyzing Open Source Communities, governance rules and boards
may also impact how open a project is. Yet, a concentration of power,
62
OpenStack Magnum
733
IBM
26%
Cisco
13%
runC
1,657
Docker
36%
Red Hat
20%
ServiceD
5,955
Zenoss
41%
Mesos
4,838
Mesosphere
50%
22%
Mantl.io
1,659
Asteris
51%
Mesosphere
25%
28%
63
rkt
1,922
CoreOS
52%
Endocode
29%
3,953
Pivotal
53%
IBM
11%
Chronos
766
Mesosphere
55%
Airbnb
11%
Docker
17,116
Docker
58%
Marathon
3,394
Mesosphere
66%
11%
Kubernetes
16,622
72%
Red Hat
15%
appc Spec
785
CoreOS
74%
Red Hat
4%
628
Joyent
74%
Human API
23%
Packer
4,857
HashiCorp
75%
Powerstrip
76
ClusterHQ
82%
Red Hat
14%
Vagrant
7,465
HashiCorp
83%
PetroFeed
2%
Brooklyn
11,213
Cloudsoft
84%
Deis
4,357
Engine Yard
85%
SOFICOM SpA
3%
Tsuru
9,869
Globo.com
85%
FundedByMe
12%
Flocker
12,472
ClusterHQ
86%
Red Hat
etcd
6,311
CoreOS
87%
Red Hat
5%
Flannel
351
CoreOS
87%
Red Hat
7%
Crate
4,448
Crate.io
89%
Weave
3,172
Weaveworks
89%
VMware
10%
Aurora
2,723
90%
CoreOS
3%
LXD
1,855
Canonical
90%
7%
4%
2%
9%
6%
64
1,339
Metaswitch Networks
91%
Red Hat
1%
Photon
677
VMware
91%
EMC
9%
Pachyderm
1,458
Pachyderm
96%
Dakis
1%
Fleet
2,325
CoreOS
97%
Red Hat
1%
Rancher
640
Rancher Labs
98%
FIG 4: Most projects receive a majority of their contributions from employees of one
company.
As pointed out above, all but three projects receive a majority of their
contributions from employees of one company. OpenStack Magnum and
runC had the lowest concentration of contributions coming from one
company.
If we look past the Elephant Factor, there is more variation regarding the
percentage of contributors employed by a single company. For example,
contributor base. Although many of these developers are only making one
contribution, this is a signal that they are engaged enough in the
community to get their commits accepted. The project with the highest
Whale score was Vagrant, a mainstay of many open source developers.
Although HashiCorp employees make most of the contributions, the
project has open source credibility as evidenced by so many people
buying into the project enough to actually contribute to it.
There are many smaller companies in the ecosystem that are providing
65
Packer
329
HashiCorp
3%
2%
Vagrant
413
Red Hat
3%
Deis
138
Engine Yard
9%
Docker
466
Docker
9%
OpenStack Magnum
62
IBM
10%
8%
runC
127
Docker
11%
rkt
75
CoreOS
15%
5%
Mantl.io
41
Cisco
15% Asteris
7%
LXD
33
Canonical
18%
3%
Chronos
78
Mesosphere
18% Airbnb
5%
Kubernetes
425
16%
Marathon
141
Mesosphere
20%
1%
Mesos
100
Mesosphere
20% Twitter
6%
etcd
221
Red Hat
21% CoreOS
9%
Fleet
53
CoreOS
9%
Flannel
30
CoreOS
23%
Brooklyn
47
Cloudsoft
28%
4%
Pachyderm
10
Pachyderm
30%
10%
Aurora
52
37%
4%
Tsuru
53
Globo.com
38%
4%
HashiCorp
2%
2%
Red Hat
8%
66
Weave
22
Weaveworks
41%
9%
Powerstrip
ClusterHQ
14%
Rancher
16
Rancher Labs
44%
6%
Crate
22
Crate.io
45%
9%
Pivotal
50% IBM
8%
Flocker
20
ClusterHQ
55%
5%
appc Spec
56
Red Hat
57%
5%
ServiceD
35
Zenoss
57%
6%
23
Joyent
9%
Photon
23
VMware
74% EMC
4%
16
Metaswitch
Networks
6%
FIG 5:
respectively.
Companies like ClusterHQ, Crate.io and Rancher have products that are
primarily based on open source projects, and each company accounts for
most of their own contributions, as well as contributors.
The Crate project seems to be isolated from other projects. None of the
developers working on it have contributed to any other project we
evaluated. Note that Crate.io is based in Berlin, and Lovely Systems, the
other provider with employees working on the project, is based in Austria.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
67
68
69
70
71
RETHINKING
THE DEVELOPMENT
AND DELIVERY
ENVIRONMENTS
In this podcast, Scott Johnston talks to Alex Williams
delivery prior to Docker, and how large code blocks
took weeks and months to ship. But it wasnt, and
still isnt, just about how fast your team delivers: its also about the
programmable infrastructure thats available. Following the success
servers, Docker helped teams rethink the development environment,
and eased friction in the delivery pipeline. Scott also talks about
containers as a reasonable starting point for microservices and
distributed computing, and how tools like Compose and Universal
Control Plane are looking to elevate the usage of microservices.
Listen on SoundCloud or Listen on YouTube
Scott Johnston is the senior vice president of Product Management
at Docker, responsible for strategy of products and technologies.
marketing, product management, and strategy at Puppet Labs. Before that, he
served in leadership and operational roles in product management,
engineering, business development, and marketing for disruptive companies,
72
CONTAINERS IN
PRODUCTION, PART II:
WORKFLOWS
by MARK BOYD
73
Then, images are created and these builds are sent to continuous
integration tooling to continue with testing and merging the new code.
74
Bintray to store
container images.
image needs to be built and then tested through various stages of QA. For
many of the application environments using containers in production, this
is done using continuous integration tools, notably Jenkins, to automate
as much of this process as possible.
75
uses FROM www-base. When working locally, devs pull from the master
in GitHub and mount that code into the container theyve docker pulled to
have the latest build environment. Kromhout says this is faster than using
Vagrant. Jenkins just builds the one image for all of the platform, it just
builds and tags one image, she says. It is really nice for consistency.
76
are tagged for staging and then prod via fabric, a Python-based tool. So
the same Docker image that passed QA is what is pushed out into
production (from the distributed private Docker registry).
77
Other Alternatives
Built.io
mobile-backend-as-a-service (MBaaS) container architecture. This
management layer uses an API as the main communication channel to
and create larger containers for higher-paying customers.
By using a management layer connected via an API, they can also enable
their customers access to some orchestration and management functions
direct from the built.io products user interface.
78
79
80
THE EVOLUTION
OF ARCHITECTURES AT
CONTAINER-SCALE
In this podcast, Jason McGee talks about how the
monolithic approach to architecture came out of
the service-oriented architecture (SOA)
movement. Now were trying to decompose the
monolith to uncover the complexities of this evolving pattern.
Listen on SoundCloud or Listen on YouTube
Jason McGee
on core foundational cloud services, including containers, microservices,
continuous delivery and operational visibility services.
81
LEVERAGING
CONTAINERS TO PROVIDE
FEEDBACK LOOPS FOR
DEVELOPERS
by VIVEK JUNEJA
82
83
84
85
in the service.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
86
87
Reaching Maturity
Despite its roots and vibrant history, the current container ecosystem is
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
88
still in its infancy, and changing nearly every day. The criteria for creating a
mature platform for fast feedback loops will also, surely, change in the
course of container ecosystem maturation. However, it does already
provide the building blocks for creating a hyper-agile feedback loop, which
89
A HISTORICAL
PERSPECTIVE AND THE
FUTURE OF CONTAINERS
In this podcast, Bryan Cantrill starts with a broad
history of how technologies, such as AJAX, JSON,
COBRA and SOA, contributed to the rise of the
monolith. And from this historical perspective, he
the word itself. A very similar situation happened with containers
and technologies like jails, FreeBSD and Solaris Zones. But whereas
containers in the past were used to support very large applications,
(microservices). Bryan goes on to talk about the history of legacy
creating optimal development environments for microservices.
Listen on SoundCloud or Listen on YouTube
Bryan Cantrill
platforms. Prior to joining Joyent, Bryan served as a distinguished engineer at
In particular, he codesigned and implemented DTrace, a framework for
dynamic instrumentation of production systems. Bryan also cofounded the
Fishworks group at Sun, where he designed and implemented the DTrace-
90
HOW CONTAINERS
AND MICROSERVICES
WORK TOGETHER
TO ENABLE AGILITY
by ALEX WILLIAMS
the system of record. Today, the emergence of an application-centric approach is causing many to rethink that view, placing the application
These projects serve as the core to a new stack economy, and they are the
underlying foundation for automated, programmable infrastructure.
91
92
93
94
95
view, there are monoliths and there will be monoliths for some time.
You cant take a monolithic ticketing system and containerize it today,
Owens said. But there are pieces of the app, such as DNS services,
containerized.
The scheduler is the most important part of the system when considering
how microservices are used. From Owens perspective, the most standard
schedulers are focused around Mesos with Zookeeper and Marathon.
schedulers.
There are two aspects to schedulers: the functioning of scheduling the
of three control nodes per set of six main service nodes. This provides a
This speaks to the conversation we will hear in the year ahead about this
emerging microservices layer and how you orchestrate services, the
schedulers, the control plane underneath, and how they all connect
together. It is, in essence, a new stack of orchestration that puts an emphasis
on matters, such as application portability and self-organized containers.
96
97
Conclusion
come with distributed services. There needs to be a tool and
management system around the microservices and the containers that
are getting packaged. The roots of todays microservices platforms and
once knew as service-oriented architectures.
The emergence of microservices can be viewed as an evolution of the
to scale-out programmable and dynamic services that served millions of
users. Today, the approach developed by these pioneers is the foundation
are now the heart and soul of their entire organization.
98
WHAT DOES IT
MEAN TO
BE CLOUD NATIVE?
In this podcast, Michael Cot talks about using the
cloud native moniker to describe three primary
principles: utilizing microservices architectural
patterns, implementing a DevOps approach to
running production systems and development environments, and
delivery. Cot goes on to elaborate more on each of these cloudnative principles and what it means to address them. He also talks
about how Pivotal Cloud Foundry has all the tools and services on
their platform to meet and exceed the needs of cloud-native
businesses. Listen on SoundCloud or Listen on YouTube
Michael Cot works at Pivotal in technical marketing. Hes been an
industry analyst at 451 Research and RedMonk, worked in corporate
programmer for a decade before all that. He blogs and podcasts at
is @cote on Twitter.
and
99
THE ROLE OF
PLATFORM-AS-A-SERVICE
IN THE CONTAINER ERA
by SUSAN HALL
100
production environments.
101
102
Meanwhile, even though Docker is only two years old, Collison is already
thinking about what comes next. The virtualization wave has been a
10-plus year journey, he says.
103
104
INTEGRATING
CONTAINERS
ALLOWS BUSINESSES
TO MOVE FASTER
In this podcast, Kit Colbert discusses how IT
container technologies. Containers present an
opportunity for businesses to move faster and
present greater value to their customers, and it depends heavily on
how you integrate the rest of your tooling with these technologies.
engineer for Workspace Portal, and the lead management architect for the
vRealize Operations Suite. At the start of his career, he was the technical lead
behind the creation, development and delivery of the vMotion and Storage
vMotion features in vSphere.
105
ACHIEVING INNOVATION
AND AGILITY
WITH CLOUD-NATIVE
APPLICATION
ARCHITECTURES
by SAM CHARRINGTON, FOUNDER AND PRINCIPAL ANALYST,
CLOUDPULSE STRATEGIES
106
107
Microservices
microservices is easier said than done.
In their article on the topic, James Lewis and Martin Fowler describe the
microservice architectural style as:
108
LEGACY
TRANSITIONAL
CURRENT
APPLICATION
ARCHITECTURE
Monolithic
REST, SOA,
Object-oriented
programming
Microservices
DEPLOYMENT
ENVIRONMENT
Physical machines
Virtual machines
Containers
DEPLOYMENT
APPROACH
Waterfall, manual
deployment
Continuous int.,
deployment
automation
Continuous
delivery, cloud
platforms
FIG 1: The previous names of strategies, models and patterns that are sometimes
109
110
Why Microservices?
The microservices approach yields numerous important business and
Faster and easier deployment: Small services are faster and easier
to deploy than large, monolithic applications, and deployments are
easier to validate, again reducing risk.
Easier scaling: Independent microservices running in their own
processes need not necessarily run on their own hardware but are
scaling. In the same manner, microservices allow application
CPU intensive) to be more easily deployed in their optimal
environments than with monolithic applications.
Easier code maintenance: Maintaining a collection of microservices
each responsible for one thing is much easier than maintaining a
monolithic application. This is in large part due to the fact that each of
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
111
services with limited scope are easier to debug than large monolithic
applications.
Freedom to use the right tool for the job: Because each
microservice is developed, runs and is maintained independently,
technologies it feels will best enable it to meet the needs of the
service. This means that in the same application, one microservice
might use a JVM-based language and a NoSQL datastore while
another uses Node.js and a relational database.
Reduced technical debt: With individual microservices that are
easily rewritten or refactored without impacting the larger application,
large technical debt.
Greater team ownership: Self-contained services allow teams to
take greater responsibility for their design and operation, promoting
greater pride of ownership.
Rapid engineer onboarding: Similarly, a new engineer joining an
existing microservices team can gain an understanding of the service
rapidly. Many companies using microservices and continuous
deployment pride themselves on achieving day-one productivity for
new engineers.
Greater resilience: Because microservices are operated
independently, greater emphasis is placed on monitoring their ongoing
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
112
Development Challenges
Communications issues: One obvious challenge for microservices
architectures lies in inter-service communications, which introduces a
degree of latency that is not present in monolithic applications.
Applications must be engineered to tolerate not just additional
latency, but variable latency, retransmissions and service failure.
113
Operational Challenges
Deployment: Many small, independently deployed services increase
applications various versions and promotion levels. As a result, the
management and deployment automation right is very high.
Monitoring: Similarly, the many independent service endpoints that
must be monitored on an ongoing basis can result in an increased
system administration and maintenance burden for organizations
using microservices.
to address, in that the only way to do so is the development of a set of
competencies, processes and practices within the organization that
supports the microservices style of development and architecture.
However, organizations considering or adopting microservices can take
solace in the fact that the operational challenges of microservices, while
great many tools and technologies for easing the burden of managing
large-scale microservices applications. Two of the most important of
these are containers and container-based application platforms.
Containers
To illustrate the nature of the deployment challenges impacting
microservices, consider a single legacy monolithic application that is
being gradually modernized by migrating new and existing functionality to
a more modern microservices-based implementation.
APPLICATIONS & MICROSERVICES WITH DOCKER & CONTAINERS
114
115
116
117
CBAP Requirements
In the emerging microservices and container-centric world, organizations
118
119
Conclusion
IT organizations are under increasing pressure to enable and drive
120
121
APPLICATIONS
& MICROSERVICES
DIRECTORY
122
MICROSERVICES FRAMEWORKS
Product/Project (Company or Supporting Org.)
Languages Targeted
JVM
JVM
C++, C
JVM
Go
C ++
JVM
123
Languages Targeted
JVM
JVM
JVM
web framework
JVM
JVM
Go
Go
Go
124
Languages Targeted
Go
Go
Other
Go
JVM
N/A
Go
C++, C
JVM
Go
125
Languages Targeted
JVM
JVM
Go
JVM
JVM
JVM
126
Languages Targeted
JVM
JVM
JVM
Go
C++, C
JVM
N/A
JVM
127
Languages Targeted
JVM
JVM
makes it easy
Open Source Spring Cloud (Pivotal Software)
JVM
based
Open Source StrongLoop LoopBack (IBM)
JVM
JVM
JVM
128
PROVISION OF CAPABILITIES
FOR MICROSERVICES
Product/Project (Company or Supporting Org.)
Capability Type
129
Capability Type
Security
Datomic (Cognitect)
130
Capability Type
Open Source
json (N/A)
131
Capability Type
IronMQ (Iron.io)
132
Capability Type
Security
on data at
133
Capability Type
Security
Security
134
Capability Type
(N/A)
135
Capability Type
SBinary (N/A)
Security
Open Source
(Pivotal Software)
in a distributed
Open Source
(Pivotal Software)
and backend
136
Capability Type
137
Capability Type
138
DEPLOYMENT AND
CONTINUOUS INTEGRATION
Product/Project (Company or Supporting Org.)
Open Source Active Deploy (IBM)
Artifactory (JFrog)
Atlas (HashiCorp)
Bamboo (Atlassian)
Bitnami (Bitnami)
139
Calm.io (Calm.io)
140
Codeship (Codeship)
ContainerShip (ContainerShip)
DCHQ (DCHQ)
141
Docker hosts
Gradle (Gradle)
142
ION-Roller (Gilt)
143
Runnable (Runnable)
ShutIt (N/A)
Spinnaker
144
StackHut (StackHut)
TeamCity (JetBrains)
Totem (N/A)
Vagrant (HashiCorp)
145
Virtuozzo (Odin)
Wercker (Wercker)
xDock (Xervmon)
146
DISCLOSURES
The following companies mentioned in this ebook are sponsors of The
Intel, New Relic, SAP, Teridion and Weaveworks.
Horse and Elephant icons, by Joao Santos from thenounproject.com, is
licensed under CC BY 3.0 US.
Whale,
, Female Avatar,
designed by Freepik, from
147
thenewstack.io