Dzone2018 Researchguide Microservice PDF
Dzone2018 Researchguide Microservice PDF
Microservices
S P E E D, AG ILITY, AND FLEX IBILITY
VOLU M E I I
BY TOM SMITH
In this year's edition of DZone's Guide to Microservices: Speed,
37 Diving Deeper Into Microservices
Agility, and Flexibility, we surveyed our users about how they were
using microservices since our first guide on the subject last year. 40 Microservices Solutions Directory
We've found that developers are still thrilled about microservices
46 Glossary
and feel that the hype surrounding them is still warranted. We've
also seen that there is a steady adoption of microservices in
DZone is...
development, though not everyone is playing with microservices
BUSINESS & PRODUCT PRODUCTION EDITORIAL
in production yet. MATT TORMOLLEN CHRIS SMITH SUSAN ARENDT
CEO DIRECTOR OF PRODUCTION EDITOR-IN-CHIEF
TOM SMITH
a monolith to microservices, and case studies from adopting SALES JASON BUDDAY
CAMPAIGN SPECIALIST RESEARCH ANALYST
CHRIS BRUMFIELD
microservices at Google. SALES MANAGER MICHAELA LICARI MIKE GATES
JIM DYER CAMPAIGN SPECIALIST CONTENT TEAM LEAD
SR. ACCOUNT EXECUTIVE
JORDAN BAKER
MARKETING
Microservices may not be "new," but the challenge of adopting ANDREW BARKER CONTENT COORDINATOR
SR. ACCOUNT EXECUTIVE SUSAN WALL
CMO ANNE MARIE GLEN
and maximizing their potential is still present. We hope the articles BRETT SAYRE CONTENT COORDINATOR
AARON TULL
ACCOUNT EXECUTIVE
and research in this guide helps clear the air around the subject, DIR. OF MARKETING
ANDRE LEE-MOYE
ALEX CRAFTS SARAH HUNTINGTON CONTENT COORDINATOR
and that they encourage you to explore new ways to build better KEY ACCOUNT MANAGER DIR. OF MARKETING
LAUREN FERRELL
SEAN BUSWELL WAYNETTE TUBBS
applications. SALES DEV. REP. DIR. OF MARKETING COMM.
CONTENT COORDINATOR
Executive Summary
BY KA R A PH E LPS - CO N T EN T A N D CO MMU N IT Y MA N AGER, DEVA DA
Early adopters like Netflix and Amazon first began experimenting with IMPLICATIONS Java is the most popular programming language
microservices nearly a decade ago. Since then, their popularity has ecosystem used at companies where survey respondents work, sitting
grown exponentially. Rather than relying on monolithic applications that at 85%. Likewise, it’s also one of the most commonly used worldwide.
are difficult to maintain and scale, microservices break down large tasks Java is a mature language with a wide variety of resources — libraries are
into simple, independent processes that communicate with each other more readily available, and tools for microservice orchestration abound.
via APIs. Developers adopt microservices architectures to help solve In addition to developers’ familiarity with Java, these factors often make
common, complex issues like speed and scalability, while also support- the choice a straightforward one.
ing continuous testing and continuous delivery.
RECOMMENDATIONS The challenge of picking the right program-
To see what’s changed in the microservices space this year, we surveyed ming language for microservices isn’t much different than it is for other
548 tech professionals on how and why they use microservices, the service-oriented architectures. Talent and support are major consider-
challenges they face in developing microservices, and the frameworks ations. If your organization is already committed to the Java ecosystem,
and tools they find most helpful. it makes sense to continue using Java. Java 8 took some major steps
forward in its support for microservices development, as well.
DATA Among survey respondents who reported building web applica- The Not-So-Rosy Side, and What to Do About It
tions and services, 43% said they use microservices in development and DATA When asked what challenges they face when building apps with
production. 30% said they are considering them. Among survey respon- microservices, 37% of survey respondents building web apps and 39%
dents who are building enterprise apps, 36% said they use microservices of those building enterprise apps said that monitoring was the most
in development and production. 28% said they are considering them. significant issue. When asked what challenges they face when refactor-
ing legacy apps to a microservices architecture, responses were slightly
IMPLICATIONS Most organizations are either considering imple- more diverse. For those developing web apps, the largest share went to
menting microservices, or already have. Microservices have a wide range “overcoming tight coupling” at 28%, closely followed by “finding where to
of applications, addressing many of the more troublesome issues faced break up monolithic components” at 27%. Those developing enterprise
in modern IT. apps also named those two categories the most frequently, each at 31%.
RECOMMENDATIONS If you’re planning to develop a new appli- IMPLICATIONS Monitoring microservices is a more complex task
cation, whether it’s web-based software-as-a-service (SaaS) or designed than monitoring monolithic applications due to multiple potential
for the enterprise, microservices may be the best way to future-proof it. points of failure. Systems degrade, and any slowdowns in performance
Still, they aren’t a one-size-fits-all solution — among survey respondents could impact your app’s dependencies. When it comes to refactoring
who said they aren’t interested in microservices, 58% said it was due to legacy apps, tasks like updating databases for loose coupling and
a lack of applicable use cases. The rest attributed their disinterest to a deciding how to divide capabilities among microservices are crucial and
lack of knowledge on the subject or a lack of training. resource-intensive.
Microservices By Any Other Language RECOMMENDATIONS This all might sound a bit daunting, but
DATA Among survey respondents working at companies with Java don’t worry! You can choose from a wide variety of tools and resources
ecosystems, 52% said using a microservices architecture has made their designed to help with these common problems. Application perfor-
job easier, compared to 40% who work with JavaScript, 26% who work mance monitoring and structural code analysis can be automated.
with Node.js, and 21% who work with Python. Among respondents Check out the Solutions Directory in this Guide for a convenient place to
developing web apps, 83% said Java is the programming language that start your research.
Key
op enterprise business applications, and 14% develop high-risk
software.
Research
–– 85% Java
–– 70% JavaScript (client-side)
–– 38% Node.js
Findings
–– 34% Python
–– 33% C#
• 43% live in Europe, 23% in the USA, and 10% in South Central Asia. proved more popular among web developers. 43% of web app developers
DZO N E .CO M/G U I D E S
Now that we know who is using microservices, and where in the SDLC has a lack of applicable use cases among this group went up by 19%.
microservices are prominent, let’s examine why developers use this But also with the passing of a year, the percentage who claimed a lack of
architectural pattern. At 68%, microservices’ ability to make applications knowledge on the subject fell by 4%.
more easily scalable proved the most popular answer to this question
among respondents. In a close second, 64% of survey takers told us that DEVELOPING MICROSERVICES
they use microservices to enable faster deployments to just one part Among our general survey population, 70% (434 respondents) reported
of an application. These two uses of microservice architectures were implementing DevOps processes such as continuous delivery. Of those
by far the most popular, with a statistical differential of 23% separating 434 respondents, 39% told us they use microservice architecture in both
enabling faster deployment from the third most popular use case, development and production, 16% use microservices in development
improving quality by having teams focus on just one piece of an app. The only, and another 6% use microservices in production only. Adding these
other notable uses, each chosen by about a third of respondents, were to all up, 61% of the 434 respondents who work with DevOps processes
improve quality by narrowing down the source of failures to a particular use microservices in some capacity when developing applications. The
piece of an app (35%) and to experiment with the architecture (34%). mean number of applications respondents are currently running with a
microservices architecture came out to five; the highest number of apps
Interestingly, if we compare this data to the type of programming reported was 50 and the lowest 0. And, of those respondents who have
language ecosystems respondents use, we find that each language refactored legacy apps to take advantage of a microservice architecture,
ecosystem lends itself to a different benefit of microservices. Among the mean number of refactored apps per respondent came out to two,
those working in the Java ecosystem, the most popular use case for with 15 being the highest number of applications reported.
microservices (chosen by 86%) was experimenting with architecture.
For those working in the JavaScript ecosystem, improving by having When asked for the language they feel best supports this type of
teams focus on just one piece of an app (chosen by 72%) came out as the microservices-based development, an overwhelming majority, coming
most popular option. For Node.js (45%) and Python (28%) ecosystem in at 82% of respondents, said Java. The second most popular option
developers, making applications easily scalable won out. was the JavaScript-based runtime environment, Node.js, with a 40%
DZO N E .CO M/G U I D E S
adoption rater among survey takers. And, with a 31% adoption rate,
Due to the benefits delineated above, 68% of respondents told us they client-side JavaScript and Python also proved rather well-liked. If we
feel microservices architecture has made their job easier, and 72% said compare the adoption rate of these languages to our data on the types of
they think the excitement around microservices is indeed warranted. applications that respondents develop (and how respondents choose to
secure their microservices), we get some intriguing results.
While a large majority of respondents enjoy working with microservices,
we did have a small faction (99 respondents) who reported to be Among both web application (83%) and enterprise business application
uninterested in microservices. The most notable reason being a lack (85%) developers, Java proved the most popular language. Python,
of applicable use cases (58%). Other responses included a lack of similarly, was statistically stable between these two user groups, with
knowledge on the subject (34%) and a lack of training (25%). All three of a 32% adoption rate among web app developers and a 31% use rate
these critiques exhibit a rather interesting year-over-year pattern. While among enterprise business devs. When we get to the data on client-side
microservices detractors decreased from 125 respondents in 2017 to the JavaScript and Node.js, however, interesting fluctuations appear. While
99 in 2018 noted earlier, the percentage of those who feel microservices 45% of web app developers reported using Node.js, only 34% reported
HAS USING MICROSERVICES AS ARCHITECTURE MADE YOUR DO YOU THINK THE EXCITEMENT AROUND MICROSERVICES
JOB EASIER? IS WARRANTED?
using client-side JavaScript for their microservices; among enterprise frameworks/tools reported for building microservices. The platforms
business devs, 42% reported using Node.js, while only 28% claimed to used to manage microservices once built, however, had a more even
use JavaScript on the client-side. This is interesting to note, as one of the spread. 32% of those who microservices management platforms told us
main advantages of Node.js is the ability to code both server-side and they use Istio, 18% use Kong, 17% use Conduit, and 13% used Linkerd.
client-side applications in the JavaScript language. And yet, we see far
Looking at the data for communication protocols, three main choices
more respondents interested in using Node.js for their microservices-
emerged: HTTP (84%); Apache Kafka (25%); RabbitMQ (22%). If we
based development than client-side JavaScript.
compare this data to the four largest programming language ecosystems
When we asked respondents how they secure their microservices, 47% delineated in the Demographics section (Java, JavaScript, Python, and
said JSON web tokens, 43% reported using OAuth 2, and 28% told us Node.js), we find that HTTP remains the first choice for communication
they implement user authentication. When we compare these numbers protocols among a large majority of respondents. Here’s a breakdown
to the data on the top microservices-friendly languages, we find that of HTTP users per ecosystem: 84% Java; 86% Node.js.; 85% JavaScript;
JSON web tokens proved more popular among these respondents than 84% Python. Apache Kafka proved more popular among Python
among the general survey population. 55% of those who use Node.js ecosystem developers than anyone else, with a 33% adoption rate.
for microservices development reported using JSON web tokens, 52% Similarly, RabbitMQ saw a 30% adoption rate among Node.js ecosystem
who use JavaScript use JSON web tokens, and 49% who use either Java developers, an 8% increase over the general survey population.
or Python use JSON web tokens to secure their microservices. User
For the environments used to build, host, and deploy their microservices-
authentication, too, proved more popular among users of these four
based applications, over half of respondents (70%) use containers.
languages than the general population, while OAuth 2’s adoption rates
Container technology factored in heavily in development, with 27% of
witnessed far less fluctuation.
respondents using containers only in the development stage and 35%
Despite the popularity of microservices, this architectural pattern using containers in both development and production. Among this
comes with its own set of challenges. 58% of respondents reported that group of survey takers doing microservice development in containerized
DZO N E .CO M/G U I D E S
monitoring can present an issue when building apps with microservices. environments, 51% use Kubernetes as their container orchestration
Fascinatingly, the second most oft reported challenge of building apps tool. To delve deeper into the topics of containerization and container
with microservices was changing culture to be open to microservices. orchestration, head over to the DZone Guide to Containers: Development
40% of respondents told us cultural shift presents an issue. Though and Management.
other, more technical, challenges were reported — like changing API
Even with all these statistics, developers still appear split on the
contracts (34%) and communicating between microservices (32%) — it
usefulness of tools and frameworks for microservices development. 60%
appears that organizational structure has become a bigger roadblock to
of respondents told us they feel that tools and frameworks have provided
microservice adoption.
sufficient best practices for working with microservices, with 40% feeling
there is still work to be done on this front.
TOOLS FOR BUILDING MICROSERVICES
Given that 82% of respondents said they felt Java was one of the
languages that best supports microservices, it comes as no surprise
that Spring Boot (57%) and Java EE (22%) were the two most used
WHAT PROTOCOLS DO YOU USE TO COMMUNICATE WHAT CHALLENGES DO YOU FACE WHEN BUILDING APPS
BETWEEN SERVICES? WITH MICROSERVICES?
QUICK VIEW
How Kafka Solves 02. HTTP REST APIs are often simple
to start with but become complex as
systems grow.
Communication Issues
microservices architecture, but have
scaling limitations.
Microservices have communicated with each other in different ways queuing and what to do if the amount of incoming requests exceeds
since their inception. Some have preferred to use HTTP REST APIs, but the node's capacity. For example, if you assume that you have a long
these come with their own queuing issues, while some have preferred chain of services preceding the one exceeding its capacity, all of the
DZO N E .CO M/G U I D E S
older Message Queues, like RabbitMQ, which come with scaling and preceding services in the chain will need to have the same sort of back
operational concerns. pressure handling to cope with the problem.
Kafka-centric architectures aim to solve both problems. Additionally, this model requires that all of the individual HTTP REST
API services need to be made highly available. In a long processing
In this article, I'll explain how Apache Kafka improves upon the pipeline made of microservices, none of the microservices can afford
historical HTTP REST API/message queuing architectures used in to lose all of their component parts and this only works as long as at
microservices and how it further extends their capabilities. least one process from any given group is still operating normally.
A TALE OF TWO CAMPS This often requires load balancers to be put in front of these
The first camp in our story is one where communication is handled microservices. Also, service discovery is often a must since the different
by calling other services directly, often over HTTP REST APIs or some microservices need to find out where to call in order to communicate
MESSAGE QUEUES
Another way of building microservices communications revolves around In many other message broker systems, foreknowledge of who would
the use of a message bus or message queuing systems. Old-fashioned be reading the message was needed; this hampered the adoption of
Service-Oriented Architecture called these enterprise service buses new use cases in traditional queuing systems.
(ESBs). Often, they've been message brokers like RabbitMQ or ActiveMQ.
When using Apache Kafka, messages are written to a log-style stream
Message brokers act as a centralized messaging service through called a topic and the senders writing to the topic are completely
which all of the microservices in question talk to each other, with the oblivious as to who or what will actually read the messages from there.
messaging service handling things like queuing and high availability to Consequently, it is business as usual to come up with a new use case to
ensure reliable communication between services. process Kafka topic contents for a new purpose.
By supporting message queuing, messages can be received into a Kafka is completely agnostic to the payload of the sent messages,
queue for later processing instead of dropping them when processing allowing messages to be serialized in arbitrary ways, though most
capacity is maxed out during peak demand. people still use JSON, AVRO, or Protobufs as their serialization format.
However, many message brokers have demonstrated scalability You can also easily set ACLs to limit which producers and consumers
limitations and caveats around how they handle message persistence can write to and read from which topics in the system, giving you
DZO N E .CO M/G U I D E S
and delivery in clustered environments. centralized security control over all messaging.
Another large topic of conversation around message queues is how It's common to see Kafka employed as a receiver of firehose-style
they behave in error cases, e.g. whether the message delivery is data pipelines where the data volumes are potentially enormous. For
guaranteed to happen at least once, at most once, etc. example, Netflix reports that they process over two trillion messages a
day using Kafka.
The semantics chosen depend on the message queue implementation,
meaning you will have to familiarize yourself with its message One of the important properties that consumers have is that when
delivery semantics.
message load increases and the number of Kafka consumers changes
due to faults or increased capacity, Kafka will automatically rebalance
Additionally, adding a message queue to an architecture adds a new
the processing load between the consumers. This moves the need to
component to be operated and maintained, and network latency
is also increased by having one additional network hop for sent handle high availability explicitly from within the microservices to the
Security matters are slightly simplified in this model by the centralized The ability to handle streaming data extends Kafka's capabilities
nature of the Access Control Lists (ACLs) that can be used with beyond operating as a messaging system to a streaming data platform.
message queuing systems, giving central control over who can read
To top it all off, Apache Kafka provides fairly low latency when using
and write what messages.
it as a microservices communication bus, even though it incurs an
Centralization also brings some other benefits in regard to security. additional network hop for all requests.
For example, instead of having to allow all services to connect to each
This powerful combination of low latency, auto-scaling, centralized
other, you can allow only connections to the message queue service
management, and proven high availability allows Apache Kafka to
instead and firewall the rest of the services away from each other,
extend its reach beyond microservices communications to many
decreasing the attack surface.
streaming real-time analytic use cases that you’ve yet to imagine.
QUICK VIEW
Microservices with
functionality step-by-step, rather than
all at once.
BY SAMIR BEHARA
SOLUTION ARCHITECT, EBSCO INDUSTRIES
DZO N E .CO M/G U I D E S
Working in a legacy codebase has its own challenges. With teams from pushing any of their code changes until Team
the advent of new technologies, organizations have found it B pushes a code fix. Since you are dependent on a single
difficult to continue delivering and staying competitive with pipeline to deploy changes from multiple teams, there is a
their monolithic legacy applications. To keep up with the market high chance of one team blocking the other, causing delays in
demand, its necessary to continuously evolve your applications. feature delivery to the business.
Transforming your current legacy applications into a number of
small microservices seems to be the best approach.
Maintaining a legacy application is cumbersome and often
leads to additional work because of multiple reasons:
• Lack of unit tests
• Violation of the Single Responsibility Principle
Over the years, the code complexity for these applications has component is strangled, the new service is put into use, and
grown and components were tightly-coupled with each other, the old component is decommissioned altogether.
which makes it difficult to implement good automated testing
Any new development is done as part of the new service and
around the codebase. Making a simple change in one class has
not part of the Mmonolith. This allows you to achieve high-
the potential to break an existing functionality implemented in
quality code for the greenfield development. You can follow
an interconnected module. Rather than relying on failing tests,
Test-Driven Development for your business logic and integrate
we have to depend upon a few key people who have been
SonarQube with your deployment pipeline to prevent any
working on these systems for an extended period of time. This
technical debt from accruing.
creates dependencies and delays in getting changes reviewed.
In the below diagram, the Order Service is eventually strangled
Finally, when everyone realized that this was not a
from the monolith into an independently deployable service
sustainable model to deliver business features, we decided
with its own CI/CD pipeline. Team A is now not dependent
to make architectural changes to decompose the monolithic
upon any issues with other teams.
application into smaller, loosely-coupled services. This would
enable teams to deploy changes to production more frequently.
REFACTOR THE MONOLITH OR REBUILD IT
FROM SCRATCH?
technical debt associated with the legacy system into our new
modern system.
You need to have processes in place to streamline this
Also, if you go ahead with rewriting the monolith from scratch, transition from monolith to microservices. To implement
you cannot start using the new system until it is complete. the Strangler Pattern, you can follow three steps: Transform,
You are in a corridor of uncertainty until the new system is Coexist, and Eliminate.
• Both the monolith and the newly built component need not a big undertaking when you plan to do the migration in
to be functional for a period of time. Sometimes the tran- increments and small pieces.
sitional phase can last for an extended duration.
Reducing the complexity of an application enables you to
• When the new component has been incrementally deliver business features faster. It also allows you to scale your
developed and tested, you can get rid of the legacy application based on increasing load. Having an automated CI/
monolithic application. CD pipeline makes it a lot easier to deploy the microservices
and can make the transition from monolith to microservices
much smoother.
HOW DO YOU SELECT WHICH COMPONENTS
TO STRANGLE/REFACTOR FIRST?
• If you are following the Strangler Pattern for the first
and selecting a simple component is not a bad option.
This will ensure that you gather practical knowledge and
acclimatize yourself to the challenges and best practices
CONCLUSION
before strangling a complex component.
Transforming your existing legacy monolithic application into
• If there is a component which has good test coverage and cloud-native microservices is a nice end goal to have, but
less technical debt associated with it, starting with this the journey is challenging and needs to be well architected
component can give teams a lot of confidence during the and planned. In this article, we discussed a design pattern
migration process. called the "Strangler Pattern," which can assist you in this
journey. Teams can continue delivering business value by
• If there are components which are better suited for the
doing all greenfield development as part of new services
cloud and have scalability requirements, then start with
and incrementally migrate from monolith to microservices.
one of those components.
However, keep in mind that strangling a monolith is not a
quick process and may take some time.
• If there is a component which has frequent business
requirements and hence needs to be deployed a lot Please let me know if you have any questions and I would be
more regularly, you can start with that component. This happy to discuss them.
will ensure that you don't have to redeploy the entire
monolithic application regularly. Breaking it into a sep-
arate process will allow you to independently scale and
SAMIR BEHARA is a Solution Architect with EBSCO
deploy the application.
Industries and builds cloud native solutions using
cutting edge technologies. He is a Microsoft Data
The cloud migration journey is not an easy one and you will Platform MVP with over 12 years of IT experience.
bump into multiple hurdles. The Strangler design pattern Samir is a frequent speaker at technical conferences and is the
assists you in making this journey a bit painless and risk-free Co-Chapter Lead of the Steel City SQL Server UserGroup. He is
since you are dealing with small components at one time. It's the author of www.dotnetvibes.com.
For Kubernetes.
Built on Istio.
Any questions? TRY IT FOR FREE
aspenmesh.io
THE DZONE GUIDE TO MICROSERVICES: SPEED, AGILITY, AND FLEXIBILITY
what technologies, frameworks, and tools are best for their do-
main. The downside is that several different teams, composed of
The Importance many developers, require widely varying levels of access. Access
control that provides an appropriate separation of concerns is
of RBAC for
critical for large organizations. The ideal balance is providing the
lowest level of access that enables developers to see and control
all that they need to.
Microservices in the Role-based access control solves the challenges that come with
needing to provide varying levels of access to distributed teams
Enterprise in the enterprise. Providing RBAC is a task made easy with a ser-
vice mesh. Service mesh enables platform owners to ensure app
developers can only write policy for their own apps so that they
Microservice architectures come with huge upsides. They can move quickly without impacting other teams.
PARTNER SPOTLIGHT
Aspen Mesh
Aspen Mesh makes service mesh easy with an enterprise-ready distribution of Istio
They decided to work with Aspen Mesh to harness the power of Istio with the
ease of a fully-supported enterprise distribution.
QUICK VIEW
Birth of Microservices
more were born from this need.
at Google
innovations.
Our story begins in the early 2000s when Google's Search and Ads with how your software scales: microservices are useful because they
products were really taking off. At the time, the conventional wisdom address engineering management challenges. Specifically, by defining
suggested that building a reliable internet service meant buying reliable service boundaries between teams and letting them work independently,
— and expensive — servers. To keep costs down, Google engineering teams will need to communicate less and can move more quickly.
teams switched to commodity hardware. While this approach saved
DZO N E .CO M/G U I D E S
• Frequent and independent releases • A roundtrip RPC (even within a single datacenter) is about 500,000
nanoseconds.
However, even if Google arrived at the results we are hoping to
achieve with microservices, should we follow the same path? This means that a function call within a process is roughly 5,000 times
faster than a remote procedure call to another process.
THE LESSONS
LESSON 1: KNOW WHY (YOU'RE ADOPTING MICRO- Stateless services can be a great opportunity to use serverless, but even
SERVICES) stateless functions need access to data as part their implementation. If
The most important reason to adopt microservices has nothing to do some of these data must be fetched from other services (which almost
goes without saying for something that's stateless!), that performance LESSON 5: YOU CAN'T TRACE EVERYTHING...OR
difference can quickly add up. The solution to this problem is (of CAN YOU?
course) a cache, but caching isn't compatible with a serverless model. Like anyone who has tried to understand a large distributed system,
Google engineers needed tools that would cut across service
Serverless has its place, especially for offline processing where latency boundaries and give them a view of performance centered around end-
is less of a concern, but often a small amount of context (in the form of to-end transactions. They built Dapper, Google's distributed tracing
a cache) can make all the difference. "Skipping" right to a serverless- system, to measure the time it takes to handle a single transaction and
based architecture might leave you in a situation where you need to to break down and assign that time to each of the services that played
step back to a more performant services-based one. a role in that transaction. Using Dapper, engineers can quickly rule out
which services aren't relevant and focus on those that are.
LESSON 3: WHAT INDEPENDENCE SHOULD MEAN
Above, I argued that organizations should adopt microservices Tracing, like logging, grows in cost as the volume of data increases.
to enable teams to work more independently. But how much When this volume increases because of an increased number of
independence should we give teams? Can they be too independent? business transactions, that's fine — as presumably you can justify
The answer is definitely yes, they can. additional costs as your business grows. The volume of tracing data
also increases combinatorically with the number of microservices,
In adopting microservices, many organizations allow each team to
however, so new microservices mean your margins will take a hit.
make every decision independently. However, the right way to adopt
microservices is to establish organization-wide solutions for common Google's solution to this problem was simple: 99.99% of traces were
needs like authentication, load balancing, CI/CD, and monitoring. discarded before they were recorded in long-term durable storage.
Failing to do so will result in lots of redundant work, as each team While this may seem like a lot to throw out, at the scale of services like
evaluates or even builds tools to solve these problems. Worse, without Google Search, even as few as 0.01% of requests can provide ample
standards, it will become impossible to measure or reason about the data for understanding latency. To keep things simple, the choice about
performance or security of the application as a whole. which traces to keep was made at the very beginning of the request.
DZO N E .CO M/G U I D E S
State for
Specialized cloud services, such as Aiven
Microservices data cloud, are often a better choice for
handling stateful data for microservices.
Microservices architectures offer a wide array of benefits over
traditional monolithic architectures. The decoupling of individual
Thus, integrating and managing those database engines in the
components allows for independent and much faster development
microservice ecosystem remains a tough problem and could feel
cycles and evolution of system components.
like a step back in flexibility. Specialized cloud services, such as our
Aiven data cloud, are often a better choice for managing databases
While microservices architectures make application development
and other stateful systems for microservices workloads.
easier and faster, they also introduce new requirements for
handling, communicating, and persisting data which traditional
Aiven makes the best open source data infrastructure systems
monolithic shared databases do not usually play well with. Instead,
like Kafka, Cassandra, and PostgreSQL available as fully-
microservices should own their own data and use a common
managed services in all public clouds and integrates into existing
messaging platform for interservice communications.
development workflows, with open APIs and tools like Terraform to
make developers' lives easier to allow you to focus on applications,
Apache Kafka is an excellent choice for an interservice messaging
not infrastructure.
platform, and there's a variety of excellent open source database
engines supporting different use cases for your applications.
DZO N E .CO M/G U I D E S
PARTNER SPOTLIGHT
Aiven Kafka
Aiven Kafka provides high-availability and low-latency at scale for your app’s most critical workflows.
Comcast Xfinity Home is Comcast Corporation’s (Nasdaq: CMCSA) • Fully automated: The Aiven platforms handles operations such as
home security and automation product providing 24/7 monitoring balancing, failed-node replacement, and security patches.
and smarter home security features, as well as management of
• Service integrations: Aiven Kafka can be integrated with other Aiven
third-party IoT devices.
and external services.
With millions of customers using millions of networked devices • Management dashboard: Manage your Kafka topics and ACLs from
across many regions, they needed a scalable, durable solution our UI.
that could maintain sub 50ms end-to-end latency. Apache Kafka's
• Terraform support: Include your Aiven infrastructure in your
profile made sense, but it’s notoriously difficult to manage.
Terraform tooling.
After evaluating vendors according to Comcast’s strict
• Secure: Single tenant VMs with encryption at transit and rest.
requirements, they chose Aiven Kafka because of Aiven's price,
support, and performance. Aiven Kafka now forms the backbone
CUSTOMERS
for the critical workflows within their asynchronous architecture
design driving Xfinity Home. • Comcast • Toyota • Atlassian • OVO Energy • Sphero
QUICK VIEW
01. A microservice-based
architecture thrives on the autonomy
of the microservices and their instant
Protocols
fer protocol), TCP (transmission con-
trol protocol), and AMQP (advanced
message queuing protocol).
BY SARAH ROMAN
CONTENT MANAGER, ROBUSTWEALTH
DZO N E .CO M/G U I D E S
When companies have pulled together an application based across a distributed, independent set of processes? A few
on a variety of services, you can expect that they’re running intersecting ways:
the microservice architectural structure. Used primarily for
• Synchronous protocol
implementation, microservices provide patterns, protocols, and
deployment of complex applications. Foundationally, this architectural • Asynchronous protocol
style subverts many of the problems associated with monolithic • Single receiver
scaling, speed, language barriers, and organization. • Multiple receivers
While there’s large-scale adoption of microservices technology due to Since services, hosts, and clients communicate differently,
these reasons, we should home in on two parts of the microservices microservices-based messaging or communication is built on the
architecture that is often a stumbling block for developers: intersections of protocols and receivers.
communication and messaging.
SYNCHRONOUS PROTOCOL
WHAT’S SO DIFFERENT ABOUT You’ll find yourself engaging in a synchronous protocol process every
COMMUNICATION IN A MICROSERVICE
day, as it’s built into chat functions, HTTP, instant messaging, and “live”
ARCHITECTURE?
capabilities. It’s a data transfer that occurs at regular intervals and is
When transitioning from a monolithic application structure to a
usually dependent on the microprocessor clock, as there needs to be a
multi-independent structure, you’ll find immediately that calling on
clock signal between the sender and receiver. You can also understand
other components isn’t aligned to a single-process system. Within
this as a protocol that requires a primary/replica configuration, as one
the single-process system, you would typically call on components
device has control over another to ensure synchronicity.
using various language methods or via Dependency Injection, like we
see with Angular. Since a microservices-based application could be
ASYNCHRONOUS PROTOCOL
running across a large variety of servers, hosts, and processes, we see
The opposite of synchronous, asynchronous protocol works outside
communication tilted towards HTTP (HyperText Transfer Protocol),
of the constrains of a clock signal and occurs at any time and at
TCP (Transmission Control Protocol), and AMQP (Advanced Message
irregular intervals. As mentioned above, the synchronous protocol is
Queuing Protocol). All of these protocols are built out for IPC, or inter-
microprocessor dependent, meaning that these protocols are often
process communication, since they’re managing shared data.
used for the processes occurring inside a computer. With asynchronous
So, how does the microservices architecture tackle communication processes, the lack of this dependence makes them widely-used for
cloud environments and operating systems. There is no need to wait a server). This greatly improves the availability of data and reduces
for a response from receiver after sending information. inconsistency. With propagation, you can push and pull the data from
server to client, understandably helpful for local access scenarios.
SINGLE RECEIVER
Implicit in the name, a single receiver setup denotes that each request If replication and propagation aren’t current routes to be taken, you
must be processed by one receiver. So, in the case of data transmission, could also duplicate data across microservices. This works hand-in-
requests need to be staggered in order to be received, as they cannot hand with domain-model boundaries for each microservice. When
be received at the same time. working with domain-model boundaries, you’re looking to focus in
on the scope of business capabilities and create understandable and
MULTIPLE RECEIVERS meaningful separations between services. If you achieve meaningful
Multiple receivers can process multiple requests, as each request
separation, this will also help boost scalability and domain-driven
can be processed by zero to multiple receivers. For example, you’ll
choices for data and iteration.
usually see multiple receivers used in a Saga pattern, as it needs to be
asynchronous and simultaneously promote data consistency. WHAT ARE THE POPULAR COMMUNICATION
STYLES?
WHAT INTERSECTION IS POPULAR FOR So, after the larger considerations of microservice to microservice
MICROSERVICE-BASED ARCHITECTURE? communications, what do most people do?
As you can see, the architecture relies on combinations of protocols
and receivers due to the wide variety of services that need to be • Use HTTP/REST (synchronous) communication for services
consolidated and managed. The most commonly-used combination outside of the internal microservices structure. The HTTP/REST
tends to be single-receiver communication with synchronous protocol, communication is ideal for external requests, as it’s built to
like HTTP or HTTPS, as it’s calling on a regular web service. You can easily handle items like real-time interactions from a client.
imagine its frequency when we think about how Docker enabled the • Use AMQP (asynchronous) for communication methods within
use of containers that can easily run web applications.
DZO N E .CO M/G U I D E S
WHAT’S THE OVERALL IMPORTANCE OF THIS? Ultimately, the microservices architecture follows logical conclusions
While these discussion points could be somewhat topical for you, for the application of messaging and communication protocols within
maintaining and integrating microservices is really the crux of the an application. When adopting microservices, there are forward-
matter when it comes to communication. Developers want to be able thinking pieces that you have to make sure you address as you develop
to maintain the independence of each microservice while seamlessly and build a multi-faceted application: scalability, infrastructure, and
and asynchronously integrating them into an application. transitions. It’s prudent to lay a strong foundation of communication
throughout the services, as it helps it grow and affects other parts of
Synchronous communication among microservices in an application is
the application down the line.
often viewed as a complication, headache, and, at worst, a death knell.
This is due to the fact that a microservice-based architecture thrives As you broaden your knowledge on microservices and potentially head
on the autonomy of the microservices and their instant availability into development and implementation, you’ll want to explore more
to the consumer. So, even if another microservice is crippled within around creating consistency within the application, exploring the
the application, there isn’t a ripple effect throughout all of the case studies around adopting microservices, and the microservices’
microservices due to synchronous dependencies. impact on the DevOps lifecycle. The microservices-based architecture
is extremely agile and powerful, especially when approached
From anecdotal research, developers often are troubled when building
after developing the foundational aspects behind communication,
out architecture due to data dependencies. Sometimes, you’ll find that
understanding the scope of each service, and the front-end needs for
one microservice needs the data from another microservice within the
clients and consumers.
application. If you were to use synchronous communication to request
the data, there’s no backup in place if that requested microservice
SARAH ROMAN is currently the Content Manager for
were to suddenly stop working. Instead of just one microservice in an the FinTech company RobustWealth. She has a technical
“out-of-order” state, there would now be two (or more). background in microcomputers and microcontrollers
and has worked on a variety of writing projects that cover
HOW DO I AVOID SYNCHRONOUS how-tos and implementations. She primarily writes
DEPENDENCIES? articles geared towards technology information and education. Prior
Replication and propagation will help sidestep the synchronicity to her roles in technical writing and content management, she was a
issue. With replication, you can store data in more than one site (like high school English teacher.
discusion, and inevitable disillusionment from developers across the web. For
DZone's Guide to Microservices, we decided to walk down the modular
architecture assembly line and ask 548 DZone Readers whether they’re
using microservices or not, and what they think of them so far.
Smile Station
C O PY RI G HT DZO N E .C O M 201 8
THE DZONE GUIDE TO MICROSERVICES: SPEED, AGILITY, AND FLEXIBILITY
Microservices. Massive
Modernize the Mega
innovations. monolith
fast.
Break up applications
Modernize the monolith with into microservices
AMPLIFY™ API Builder
to innovate
• Accelerate faster
building of microservices and
APIs that drive business value
• Quickly build mediations
• Mobilize microservices and APIs that drive
as independently
scalable
business microservices
value
• Target
• Mobilize new channelsas
orchestrations and devices with
independently
fast, easy,
scalable and secure access to
microservices
enterprise resources
• Target new channels and devices with easy AMPLIFY™ API Builder
TRY IT FOR FREE
and secure access to enterprise resources
axway.com/api-builder-free-trial
T HE DZO NE GUIDE TO MICROSERVI CES: SPEED, AGI LI TY, AND F L E X I BI L I T Y PAG E 2 2 O F 47
THE DZONE GUIDE TO MICROSERVICES: SPEED, AGILITY, AND FLEXIBILITY
Modernizing the
complex to scale out and manage, so you absolutely need a
solution that lets you quickly orchestrate and mediate APIs
Microservices Projects 2. Service mesh enables safe and reliable fast inter-service
communication
PARTNER SPOTLIGHT
API Builder provides everything you need to rapidly create microservices or APIs • Simplifies orchestration and mediation with visual
accessing enterprise resources on-premises or in the cloud, quickly orchestrate creation of custom reusable nodes
and mediate them to target new channels or devices, and deploy them to your own
• Connects faster to enterprise and cloud services to
private cloud no matter where it is running.
expose their value
• Add value to existing APIs or create new APIs • Increases speed and frequency with an independent-
ly deployable solution
• Read and write data to and from an external data source (such as MySQL,
• Relieves the pain of scaling for each API
MongoDB, Oracle 12g DB, or in-server memory) using a library of free, open
source, and enterprise-grade connectors
QUICK VIEW
Microservices
03. You need a pragmatic lens
through which to judge and apply
microservices and FaaS to your
existing technology stack.
BY CHRISTIAN POSTA
CHIEF ARCHITECT, RED HAT
In your journey to cloud-native nirvana, you may be adopting apply it in the context of our existing technology and IT departments.
microservices architectures for your next-generation applications. Let's take a look at a model for understanding how microservices
You may have had some initial successes with DevOps and architectures and serverless along with Functions as a Service fit
DZO N E .CO M/G U I D E S
automating your builds to help forge a path forward for your into our toolbox.
microservices journey. After a year or so, you may also be trying to
First let's understand why we would use a microservices architecture.
convince the rest of the organization to go down this path as well.
The main reason you'd opt to use a microservices architecture is to
Unfortunately, whether anticipated or not, you'll run into issues.
improve the speed at which you're able to make changes to your
Microservices is a complex architectural pattern and distributed
application when your application's monolithic nature has become
systems themselves are difficult to get right. While you march down
the source of bottlenecks and impedance for change. All of the other
the path of working through and solving some of these challenges,
benefits of microservices are derived from that basic premise. Of
you will certainly have naysayers and folks who wish to go in a
course, the reason why we'd want to go faster with our changes to
different direction. With how fast technology moves, and with the
our applications is to quickly get new features and functionality out
new shiny options for building services and applications, can you
to our customer to test whether we can achieve the expected positive
be sure your effort to make microservices a successful endeavor for
outcomes as a result of these changes. If we make changes to our
your organization is not in vain?
software in an effort to improve our business value and it does not pan
The simple answer is yes. out, then we need to quickly know that and move on to try something
new. Microservices is an optimization of our application architecture to
These days, "serverless" and "functions as a service" (FaaS) have allow us to move faster and get those changes out quicker.
found themselves at the early side of the hype cycle. Some folks
Most organizations will find that some percentage of their custom-
have gone so far to say that serverless and functions are the next
built applications will benefit from an iterative progression to a
evolution of microservices, and that you should just skip the whole
microservices architecture. These applications will benefit from
microservices architecture trend and go right to serverless. Just
this change, and as architects and developers we should not get
as you'd expect, this is a bit hyperbolic; by which you shouldn't
discouraged with the hurdles we'll see. The important thing here
be surprised. There's a lot of exciting, new technology available to
is to identify and measure improvement indicators, like how many
us as architects and developers to improve our ability to achieve
changes we can make to the software per day, how safely we're able
our business outcomes. What we need is a pragmatic lens through
to make these changes, and so on.
which to judge and apply these new technologies. Although as
technology practitioners it's our responsibility to keep up with the On the other hand, not all applications require a highly complex,
latest technology, it's equally our responsibility to know when to decomposed set of services to move faster. On the contrary, when
you're first experimenting with a minimum viable product and having to worry about solving all of the difficult technology
you're testing whether your idea has any market value, you may problems that need to be solved in order to make this happen. It's
opt for a different architecture more amenable to this part of someone else's (the service provider or cloud provider's) problem.
the lifecycle of an application. There's a good chance that for If you're able to outsource a lot of those difficult infrastructure
an MVP test, you strike out and there is very little, if any, market challenges to someone else, focus squarely on the business logic
value. In that case, you would just throw that MVP application that's differentiating to your business, pay as you go and on
away. You will probably be iterating it very quickly and eliciting demand, you're able to more quickly experiment, try out ideas,
feedback from potential users. In this case, the business value is and deliver business value for your customers.
not understood, the domain that you implement in code will be
Outsourcing this kind of functionality may not always be possible,
constantly changing (if not disappearing altogether), and you'll
however. When we decide to leverage cloud services, we give up
gain insight into your code as you go. In this environment, you'll
control of uptime/SLA, feature road-map, bug fixing, regulatory
be changing APIs, boundaries, components, etc. that make up
compliance, et. al. to someone else. This may be an appropriate
your system. Prematurely optimizing all of these components into
tradeoff for a part of the portfolio or for parts of the organization.
distributed services with API contracts et. al, will actually slow you
Others may not be comfortable doing this.
down. You'll be constantly changing your APIs and components
together and coordinating with all of your small "two-pizza" teams,
Serverless doesn't have to be a full "public cloud or nothing"
which smells of a distributed monolith. You might as well just use a
proposition, however. If we look within a single organization, parts
monolith for that and you'll be able to go faster and get farther.
of it may be "serverless" to other parts. For example, the "buying"
side of a retail operation may provide services to other parts of the
At this point, we see that microservices can be appropriate for
organization or even third-party vendors/partners that help others
some percentage of the application portfolio, while monolith
applications make sense for some other percentage. There is no build analytics, recommendations, or other applications using the
single "one size fits all" strategy. Another angle to consider when "buyer" services. With well-defined APIs, a workflow for subscribing
DZO N E .CO M/G U I D E S
building either microservices or monoliths (and it follows whether and paying for the APIs, you could use microservices/monoliths
you're optimizing an existing architecture or building to test ideas) on your own infrastructure (or cloud) and provide serverless
is whether the functionality you need to build already exists either capabilities. In many ways, this is just an evolution of Service-
as third-party services or as existing services you own within your Oriented Architecture (SOA). The big difference when you're doing
enterprise. The idea that we can fully leverage existing services to it yourself (or one part of the organization providing services
build our applications without having to procure hardware, install to another) is that the organization as a whole is not serverless;
and patch operating systems, and optimize our capacity for the someone still has to set up, manage, patch the servers and all of
highest expected throughput for the life of the software is what the the supporting infrastructure.
cloud and its services are really all about. Cloud providers and their
Ultimately, business decisions, business goals, maturity and
partners regularly offer databases, message queues, caches, CDN,
capability of an IT organization, and any existing legacy constraints
etc. and even higher-order functionality like language translation,
come in to play when we decide what application architecture or
mapping/geo-spatial coordinate mapping, weather, etc. as on-
technologies we can leverage. If you're going down the path of
demand, pay-as-you-go services that can be combined in interesting
microservices for the right reasons, don't get distracted by other
ways to build applications. When we leverage existing higher-order
shiny things. Conversely, you will need to continually invest into
services without worrying about how to install, provision, and plan
the latest technology and skills and know when to use them.
for capacity, we are moving towards a "serverless" architecture.
Monolith, microservices, and serverless all have their place.
Serverless architectures strive to re-use existing services without
worrying about what it takes to run the service. CHRISTIAN POSTA is a Chief Architect of cloud applications
at Red Hat and well known in the community for being an
Functions as a Service is related to serverless because it allows author (Istio in Action, Manning, Microservices for Java
us to use a compute model (scoped down to that of a single Developers, O’Reilly 2016), frequent blogger, speaker, open-
application function) that helps stitch together the various services source enthusiast and committer on various open-source
we may consume to build an application. In this compute model, projects including Istio, Apache ActiveMQ, Fabric8, et.al. Christian has spent
time at web-scale companies and now helps companies create and deploy
functions are spun up on-demand and you're billed only for the
large-scale, resilient, distributed architectures - many of what we now
time a function was running. This fits well with being billed on-
call Microservices. He enjoys mentoring, training and leading teams to be
demand and pay-as-you-go with the various other services you successful with distributed systems concepts, microservices, devops, and
may consume. Now you can build applications that scale without cloud-native application design.
ESB and Simplifying to create data compositions of multiple business entities that are
represented using diverse network-aware data types, such as JSON,
PARTNER SPOTLIGHT
Ballerina
Ballerina makes it easy to write microservices that integrate APIs.
Ballerina is a full-fledged, open source programming language • Sequence diagrammatic: Every Ballerina program can be displayed as a
that incorporates fundamental concepts of distributed system sequence diagram of its flow.
integration. The language offers a type-safe, concurrent
• Concurrency: The concurrency model is parallel-first since interactions
environment to implement and integrate microservices.
with remote parties always involve multiple workers.
By offering first-class support for network programming, it
aims to overcome limitations in conventional centralized and • Type system: Ballerina has a structural type system with primitive, record,
configuration-driven approaches to integration, such as those object, tuple, and union types.
with ESBs, and the complexity of programming languages,
• DevOps ready: The language includes a unit test framework, build system,
with frameworks such as Spring and Node.js, which offer
documentation generation, dependency management, and versioning, and
agility but require writing large amounts of complex and
a way to share modules of reusable code as part of its core distribution.
boilerplate code to integrate endpoints. Ballerina makes
writing and integrating microservices agile and intuitive so • Secure by default: Ballerina enforces multiple security checks and secure
that you can focus more on the business capabilities rather defaults to prevent critical security vulnerabilities.
than spending time on plumbing your services together. Find • Network-aware: Services, endpoints, and networking concepts are first-
out more: ballerina.io/learn. class constructs, which are represented graphically as well as textually.
QUICK VIEW
Angular Libraries
implementation of a screen or page
that includes data from multiple
services using Angular CLI.
BY ANTONIO GONCALVES
SENIOR SOFTWARE ARCHITECT,
DZO N E .CO M/G U I D E S
We live in a Microservices world, and this world is here to stay. • Inventory: Allows administrators to check the avail-
Back-end developers need to dive into Domain Driven Design, ability of an item in the warehouse and buy new items if
write stateless, resilient, highly available services, keep data needed.
synchronized through Change Data Capture, handle network • Generator: Generates ISBN numbers each time a new
failure, deal with authentication, authorization, JWT... and book is created.
expose a beautiful Hypermedia API so the front-end developers
We end up with two roles (user and admin) interacting with
can add a great user interface to it.
these 3 APIs through a single user interface:
complex ISBN number generator to deal with. If we model this different user interfaces, each released at its own pace. On
application into Microservices, we might end up splitting it into one hand we have three different UIs, and on the other, we
3 separate microservices: want our users to navigate into what they see as a single and
integrated application. There are several ways of doing it, and
• Store: Deals with displaying information on CDs and the one way I'm describing here is called the Client-side UI
books, allows users to buy them. composition design pattern:
/
-routing
true
# The 3 libraries for our 3 microservices UI In terms of code, despite using Bootstrap, there is nothing
$ ng generate library store --prefix str special. What's interesting is the way the routes are defined.
$ ng generate library inventory --prefix inv The AppRoutingModule only defines the routes of the main
$ ng generate library generator --prefix gen
application (here, the Home and the About menus).
THE LIBRARIES
Now when we click on Store, Inventory, or Generator, we want
the router to navigate to the library's components:
The Store library has a navigation bar at the top, therefore, it CONCLUSION
needs the routerLink directive. Notice that we only need to We've been architecting and developing Microservices for
use the child path [routerLink]="['book-list']" without several decades now (yes, it used to be called distributed
having to specify /str (no need to [routerLink]="['/str/ systems, or distributed services), so we roughly know how to
book-list']"):
make them work on the back-end. Now, the challenge is to be
<nav>
able to have a user interface which communicates with several
<div class="collapse navbar-collapse"> Microservices, developed by different teams, and at the same
<ul class="navbar-nav mr-auto"> time feels consistent and integrated for the end-user. You
<li class="nav-item dropdown">
might not always have this need (see how Amazon has totally
<a class="nav-link dropdown-toggle">Items</a>
<div class="dropdown-menu" aria-labelledby=
different UIs for its services), but if you do, then the Client-side
"navbarDropdownMenuLink"> UI composition design pattern is a good alternative.
<a class="dropdown-item"
[routerLink]="['book-list']">Books</a> If you want to give it a try, download the code, install and run
<a class="dropdown-item" it (there is only the front-end, no back-end APIs). And don't
[routerLink]="['cd-list']">CDs</a>
forget to give me some feedback. I would be interested to
<a class="dropdown-item"
[routerLink]="['dvd-list']">DVDs</a>
know what you do to aggregate several user-interfaces into "a
</div> single one."
</li>
</ul>
REFERENCES
</div>
</nav> • Building and publishing Angular libraries using Angular CLI
<!-- Page Content --> • How to build a library for Angular apps?
DZO N E .CO M/G U I D E S
<div id="content">
<router-outlet></router-outlet> • Building an Angular Library with the Angular CLI (version 6)
</div>
• Building an Angular Library?
• Angular Routing
PROS AND CONS
The Client-side UI composition design pattern has some • Client-side UI composition pattern
pros and cons. If you already have existing user-interfaces • NG CLI
per microservices, and if each one is using totally different
• Bootstrap
technologies (Angular vs React vs Vue.JS vs ...) or different
• Bootstrap sidebar
framework versions (Bootstrap 2 vs Bootstrap 4), then
aggregating them might be tricky and you might have to • Why Google Stores Billions of Lines of Code in a Single
rewrite bits and pieces to have them compatible. Repository
FLEXIBILITY
INTEROPERABILITY
PRODUCTIVITY
SCALABILITY
Cloud Foundry -
testing the code, approving it for release, compiling and publishing it.
Making Microservices
services route helps offset operational complexity. Both the Cloud
Foundry Application Runtime and the Cloud Foundry Container
Runtime manage the health of microservices. What does this mean?
Easy Your platform will automatically scale up your app when there’s
demand, watch for unhealthy instances, describe services talking
to each other, accept code being offered by Continuous Integration
If you use microservices to help your teams move faster and release
code more frequently, the path from writing code to production
W RITTEN BY CHIP CHIL DERS
should be as quick as possible. Platforms play a big part in this, coupled CTO, C LOU D FOU N D R Y FOU N DAT ION
PARTNER SPOTLIGHT
DZO N E .CO M/G U I D E S
Zipcar isn’t just in the business of car-sharing. The brand is a full-fledged software • Polyglot
company that depends on technology to manage reservations, memberships, logistics, • Multi-Cloud
vehicle tracking and maintenance. With one million customers across 10 countries,
• Runs apps at scale
Zipcar designed a bespoke solution to meet its specific needs, moving away from legacy
• Interoperability
architecture to a continuous delivery model built on cloud native technologies.
• Simplifies the developer lifecycle
The team credits Cloud Foundry Application Runtime, Cloud Foundry BOSH,
Concourse, Diego, Garden, and a customized cloud controller with having helped them
standardize across its data centers. NOTABLE CUSTOMERS
• American Airlines
Zipcar is currently running:
• The Home Depot
• 6,000 containers
• United States Air Force
• 12 BOSH directors
• Verizon Wireless
• 80+ services
• 25+ production environments
• Multiple clouds
QUICK VIEW
Executive Insights
agility, APIs, decoupling, and
management/culture.
on Microservices
has given developers and engineers
more autonomy, and it has
increased the agility and scalability
of applications.
To understand the current and future state of microservices, we • Matthew Baier, COO, Contentstack
spoke to 25 IT executives from 21 organizations. Consistent with • Anders Wallgren, CTO, Electric Cloud
the early adoption of the technology, the answers to our questions
• Priyanka Sharma, Director of Alliances, GitLab
were diverse.
• Andrew Newdigate, Infrastructure Architect, GitLab
DZO N E .CO M/G U I D E S
• Viktor Farcic, Senior Consultant, CloudBees • Asanka Abeysinghe, V.P. of Architecture – CTO Office, WSO2
• Chip Childers, CTO, Cloud Foundry • Karun Indrasiri, Director, Integration architecture, WSO2
• Gwen Shapira, Chief Data Architect, Confluent • Roman Shaposhnik, Co-founder, Zededa
1. You can see how early it is in the adoption of microservices problems you’re trying to solve by decomposing the monolithic
as the “most important elements” are all over the place with processes. It doesn’t matter that a single microservice is
business processes, scalability, agility, APIs, decoupling, and elegantly architected If the big-picture business processes aren’t
management/culture all mentioned a couple of times. executed successfully, since these are what make the customers
happy and make the company money.
Think about breaking down a business plan or process.
Understand and define different business domains in an isolated Solve the real problem around engineering and scaling.
manner. Understand the original monolithic process and what Enforce an architecture that will help the organization scale
quickly while being agile. Microservices allow you to pull off A team bigger than ten people is not efficient and hinders
the inverse of Conway’s law. They should be independently autonomy. It has given architects more independence
developed, deployed, and scaled, allowing for faster delivery and choice in selecting the technologies used by a specific
of functionality with little impact to other systems. Improve the microservice. They can select technologies that are the “best
ability to make changes and get them to the customer quickly. fit” for their specific microservice.
Think through the responsibility for each microservice and how
they will interact with one another for greater agility and scale. Microservices are beneficial to the agility and vitality of an
organization. There is greater agility and alignment along a
Isolation and API guarantees are key elements. Isolation common, product-focused vision. Microservices force you to
enables developers to iterate quickly and independently. API adopt an Agile methodology to be flexible and responsive
compatibility is key so other microservices are not impacted or because there are so many moving pieces. Testing is easier.
dependencies are created that slow down iterations. You need Teams can be moved around, the learning curve is smaller,
well-defined APIs that can be easily discovered, understood, onboarding is quicker, small teams communicate more
and executed by service clients. efficiently, and smaller code bases are easier to maintain.
Ensure microservices are adequately decoupled but avoid 3. Respondents are seeing rapid to moderate adoption of
premature decomposition. Start small and evolve. Design microservices and it seems to be driven by the adoption
applications to small teams can have full control of a service of mesh network management tools, such as Istio. Tools,
or an app that’s fully independent of everything else. If you systems, and platforms are making it easier, reducing the
are breaking down a monolithic application, take an iterative downside, and making applications more consumable. The
approach, decompose incrementally. Break out, run, and transition to microservices-oriented networking has shifted
operate with a line of decomposition before you move on. thinking about sockets to microservices. The service mesh
DZO N E .CO M/G U I D E S
Ensure autonomy for a service. Deploy independently at the takes out the shared responsibility by putting everything
finest level of granularity. in a container enabling everyone to use the same sidecar.
Serverless computing also allows applications to be even
Microservices are a management issue moving from hundreds
smaller. The concept of a service mesh sprang from nothing last
of developers working on an application to no more than 10 to
year and is continuing to generate a lot of interest and some
12 people per team. The culture of the organization is critical
adoption. However, these technologies are still in their infancy
as this is where we see the manifestation of communication
and adopters are discovering the hidden pitfalls. Patience is
problems. Without meeting the communication challenge,
required as the industry sorts itself out.
organizations don’t get the outcomes they want. Monitoring
is a huge component of microservices with heavily decoupled 4. The majority of real world use cases provided by our
distribution, service visibility becomes an issue quickly. respondents were in financial services though several people
pointed out the benefits of microservices are irrespective of
2. Microservices have made application development faster, it
domain. Everything being done in financial services can be
has given developers and engineers more autonomy, and it has
used by a number of different verticals. The biggest and most
increased the agility and scalability of applications.
relevant use case is fraud detection built out machine learning
models and putting in line with microservices. A real challenge
Microservices enable everything to move faster – development,
is agility around making an easy change to a process – like the
onboarding, feature release, adoption, uptake, feedback, and
credit worthiness of a customer. Data scientists are able to
improvement. Things happen faster once you’ve broken things
make a change to a model quickly versus changing the entire
down. You get speed with quality because there’s a smaller
software development lifecycle. Large financial institutions
surface to test.
are able to deliver new functionality using microservices while
It changes how organizations work and meet business maintaining and continuing to leverage legacy applications
requirements. Application developers get a lot of freedom. through API-based integrations. They’re able to provide new,
They get an API and can look at end user, use, and release all-digital products and services because they are better able to
in a rapid way without dealing with backend complexity. respond to customer needs without needs to rip and replace.
5. The most common issues affecting the creation and microservices are an important step on the learning journey
management of microservices are data, complexity, that will lead us closer to serverless. The promise for the
monitoring, skills, and security. A key challenge is managing software developer of getting rid of operational detail is
data and data sets with stateful and stateless data. You need to great, while the promise of huge cost savings by only
understand how to create data compositions. You need to think paying for the exact amount of compute power used is even
about monitoring and observability with autonomous services more appealing. FaaS is a few years behind microservices.
disbursed across an entire network. Infrastructure will be less of barrier to entry. Serverless and
FaaS will enable developers to go smaller. Microservices
Most traditional organizations have to move legacy apps.
are going to become even more micro with serverless.
That’s a multi-year journey. You cannot stop supporting the
Serverless and FaaS are different but are the next generation
monolith. Simplicity is the most fundamental thing to keep
of application development. There’s a lot of value in going to a
in mind. Have clarity of the domain problem you are trying
serverless model.
to solve. Create clean and simple APIs and logic that’s easy
to wrap your head around to create more complex apps and There will be improvements in the development of Kubernetes
behaviors. Microservices bring a lot of overhead. Microservices and tools provided by AWS and GCS to help go from
are more difficult to debug and troubleshoot. development to deployment and production more quickly
and easily. Simplifying as much as possible so developers,
There’s a pretty big skills gap when it comes to building,
operations, and DevOps can run the applications they want
delivering and managing microservices. Few developers
in a way that scales automatically, and everything is at their
have the skills necessary to understand the domain, code the
fingertips to troubleshoot any problems without worrying
services from data to API, understand the overall architecture,
about the underlying infrastructure and orchestration.
integrate with a CI/CD pipeline, and deliver a running service.
DZO N E .CO M/G U I D E S
know what they are trying to accomplish rather than a desire the industry.
zones
Microservices dzone.com/microservices
diving
The Microservices Zone will take you through breaking down the monolith
step-by-step and designing microservices architecture from scratch.
It covers everything from scalability to patterns and anti-patterns. It
digs deeper than just containers to give you practical applications and
business use cases.
deeper
Integration dzone.com/integration
The Integration Zone focuses on communication architectures,
message brokers, enterprise applications, ESBs, integration protocols,
web services, service-oriented architecture (SOA), message-oriented
middleware (MOM), and API management.
Cloud dzone.com/cloud
I NTO M IC R OS ERV I C ES The Cloud Zone covers the host of providers and utilities that make cloud
computing possible and push the limits (and savings) with which we can
deploy, store, and host applications in a flexible, elastic manner. The
Cloud Zone focuses on PaaS, infrastructures, security, scalability, and
hosting servers.
twitter refcardz
DZO N E .CO M/G U I D E S
@b0rk @michelebusta
Patterns of Modular Architecture
Covers 18 modularity patterns to help developers incorporate modular
@crichardson @martinfowler design thinking into development initiatives.
videos books
What Are Microservices? Building Microservices: Designing Fine-Grained Systems
Learn what microservices are, why people are moving to Get examples and practical advice to help you build, manage, and evolve
microservices, and how you can create effective microservices. your microservice architectures.
When you run microservices, every outage can feel like you’re solving a murder mystery. It’s hard to
DZO N E .CO M/G U I D E S
LightStep [x]PM helps you pinpoint the root cause and gain control over microservices complexity.
It has tracing that scales and is a unique approach to application performance management.
[x]PM analyzes 100% of the performance data, 100% of the time, with no upfront sampling, so
you never miss an outlier.
IN PRODUCTION AT
for Microservices and revealing how every service interacted and responded. [x]PM
automatically computes a transaction’s critical path, so users can
throughout an application. Users can even visually compare current D IR ECTOR OF P R OD U CT M A R K ET IN G , LIG H TST EP
PARTNER SPOTLIGHT
LightStep [x]PM
LightStep [x]PM: Taming Complexity with Distributed Tracing that Scales
Twilio Improves Mean Time to Resolution (MTTR) by 92% with LightStep [x]PM. • Provides end-to-end distributed tracing that scales
Twilio wanted to go beyond traditional monitoring approaches and deliver a
• No upfront sampling so teams never miss a transac-
flawless experience to their 1.6M developers registered on the Twilio platform,
tion that matters
as well as provide additional service and insights for premium clients. Twilio
• Segments with unlimited cardinality
uses [x]PM to help them solve production-level issues, meet their operational
excellence goals, and deliver a higher level of operational maturity to their • Streamlines root cause analysis by revealing service
customers. Results include: dependencies
• Launched segmented and detailed performance monitoring for each top • Lyft • GitHub • Segment
Twilio customer, including customer-specific root cause analysis • Twilio • DigitalOcean
Solutions Directory
This directory contains platforms, middleware, service meshes, service discovery, and distributed tracing tools
to build and manage applications built with microservices. It provides free trial data and product category
information gathered from vendor websites and project pages. Solutions are selected for inclusion based on
several impartial criteria, including solution maturity, technical innovativeness, relevance, and data availability.
Amazon Web Services Amazon EC2 IaaS Free tier available aws.amazon.com/ec2
DZO N E .CO M/G U I D E S
Amazon Web Services Amazon API Gateway API gateway Free tier available aws.amazon.com/api-gateway
Amazon Web Services Amazon ECS Container orchestration Free tier available aws.amazon.com/ecs
apigee.com/api-
Apigee Apigee API gateway, API management Free tier available
management/#/products
Available by ca.com/us/products/api-
CA CA API Management API management, API gateway
request management.html
Available by
Cloudentity Cloudentity Identity & API security cloudentity.com
request
github.com/cloudfoundry/
Cloud Foundry Diego Container runtime system Open source
diego-release
DZO N E .CO M/G U I D E S
Reactive application
Eclipse Foundation Vert.x Open source vertx.io
development platform
elastic.co/products/
Elastic Elasticsearch Search & analytics Open source
elasticsearch
cloud.google.com/kubernetes-
Google Kubernetes Engine Container orchestration $300 credit
engine
IBM IBM API Connect API management Free tier available ibm.com/cloud/api-connect
github.com/jaegertracing/
Jaeger Jaeger Distributed tracing Open source
jaeger
Demo available by
LightStep LightStep Microservices management lightstep.com
request
Linux Foundation The Linux Foundation Open-source project hosting Open source linuxfoundation.org
Microservices development
Macaw Software Macaw Free tier available macaw.io
platform
mesosphere.github.io/
Mesosphere Marathon Container orchestration Open source
marathon
microfocus.com/products/
Micro Focus Artix ESB 30 days
corba/artix#
azure.microsoft.com/en-us/
Microsoft Azure Service Bus ESB Free tier available
services/service-bus
DZO N E .CO M/G U I D E S
Available by
Mulesoft Anypoint Platform Integration platform mulesoft.com
request
Netflix Hystrix Latency & fault tolerance library Open source github.com/Netflix/Hystrix
github.com/nginmesh/
NGINX nginmesh Service mesh Open source
nginmesh
Available by
Nutanix Xi Epoch Monitoring multi-cloud apps nutanix.com/products/epoch
request
oracle.com/technetwork/java/
Oracle Java EE Java specifications Free solution
javaee/overview/index.html
oracle.com/technetwork/
Oracle Oracle Service Bus ESB Free solution middleware/service-bus/
overview
oracle.com/middleware/
SOA governance, integration
Oracle Oracle SOA Suite 30 days application-integration/
PaaS
products/soa-suite.html
DZO N E .CO M/G U I D E S
OW2 Middleware
Petals ESB ESB Open source petals.linagora.com
Consortium
network.pivotal.io/products/
Pivotal Software, Inc. RabbitMQ Message queue Open source
pivotal-rabbitmq
spring.io/projects/spring-
Pivotal Software, Inc. Spring Cloud Sleuth Distributed tracing Open source
cloud-sleuth
redhat.com/en/technologies/
Red Hat JBoss Fuse ESB Open source
jboss-middleware/fuse
redhat.com/en/resources/
Red Hat Enterprise
Red Hat Container management Open source enterprise-linux-atomic-host-
Linux Atomic Host
datasheet
roguewave.com/products/
Akana API Demo available by
Rogue Wave Software API management akana/solutions/api-
Management request
management
mashery.com/api-
TIBCO Software Inc. Mashery API management 30 days
management/saas
DZO N E .CO M/G U I D E S
github.com/TykTechnologies/
Tyk.io Tyk API management Open source
tyk
Container-optimized operating
VMWare Photon Open source vmware.github.io/photon
system
DISTRIBUTED SYSTEM: Any system or JAVA VIRTUAL MACHINE (JVM): accessed over the web in a standardized
application that operates across a wide Abstracted software that allows a way using APIs that are accessed via
network of services or nodes. computer to run a Java program. HTTP & executed on a remote system.