Escolar Documentos
Profissional Documentos
Cultura Documentos
Microservices?
Join now at
developers.redhat.com
C O NT E NT S
215
Key Characteristics of
Microservices
Microservices
Benefits of Microservices
Operational Requirements for
Microservices
Good Design Principles for
Existing Monoliths... and more!
By Arun Gupta
I N T RO D U C T I O N
The term microservices describes a new software development
B E N E F I TS O F M I C RO S E RV I C E S
W H AT A R E M I C RO S E RV I C E S?
G E T T I N G S TA R T E D W I T H M I C R O S E R V I C E S
Code (LOC).
free to pick the language and stack that are best suited
Share more.
Learn more.
Code more.
D Z O NE, INC.
DZ O NE .C O M
MICROSERVICES
different microservices.
O P E R AT I O N A L R E Q U I R E M E N TS F O R
M I C RO S E RV I C E S
not help solve all architectural issues. Before you start breaking up
a monolith, its important to make sure the monolith is designed
Microservices are not the silver bullet that will solve all
rules are:
Controller (MVC)
significant investment.
domain/component together
R E FAC T O R I N G A M O N O L I T H T O
M I C RO S E RV I C E S
and invoke it. There are several ways to register and query
functionalities. All web pages are in the root of the application, all
and how hard you test. This is all the more important when
multiple microservices are distributed all over the Internet.
D Z O NE, INC .
DZ O NE.C O M
MICROSERVICES
M I C RO S E RV I C E S D E S I G N PAT T E R N
Multiple microservices can be composed with each other to
provide composite microservices. Some common design patterns
are explained below.
AGGREGATOR
Results from multiple microservices are aggregated into one
composite microservice.
In its simplest form, an Aggregator would be a simple web page
that invokes multiple services to achieve the functionality
required by the application. Since each service (Service A, Service
B, and Service C) is exposed using a lightweight REST mechanism,
the web page can retrieve the data and process/display it
accordingly. If processing is requiredfor example, if you need
Figure 2: Refactoring to Microservices
4. Each archive has its own database (i.e. data stores are not
shared). This allows each microservice to evolve and choose
whatever type of data storerelational, NoSQL, flat file, in-
case, the Aggregator would collect the data from each individual
endpoint.
discovery.
are the most common means to achieve this. In this case, the
can evolve independently, and the needs of the business logic are
PROXY
JavaScript resources.
microservices.
D Z O NE, INC .
DZ O NE.C O M
MICROSERVICES
BRANCH
The Branch microservice design pattern extends the Aggregator
design pattern and allows simultaneous response processing
from two (likely mutually exclusive) chains of microservices. This
pattern can also be used to call different chains, or a single chain,
based upon the business logic needs.
CHAINED
only one chain, based on the request received from the client.
SHARED RESOURCES
response messaging.
D Z O NE, INC .
DZ O NE.C O M
MICROSERVICES
CO N C L U S I O N
ASYNC MESSAGING
While the REST design pattern is quite prevalent, and well
well so far, and will continue to work for years to come. Consider
request/response.
CREDITS:
Editor: G. Ryan Spain | Designer: Yassee Mohebbi | Production: Chris Smith | Sponsor Relations: Chris Brumfield | Marketing: Chelsea Bosworth
COMMUNITIES: Share links, author articles, and engage with other tech experts
JOIN NOW
DZONE, INC.
150 PRESTON EXECUTIVE DR.
CARY, NC 27513
DZone communities deliver over 6 million pages each month to more than 3.3 million software
developers, architects and decision makers. DZone offers something for everyone, including news,
tutorials, cheat sheets, research guides, feature articles, source code and more.
888.678.0399
919.678.0300
REFCARDZ FEEDBACK WELCOME
refcardz@dzone.com
Copyright 2015 DZone, Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any
DZONE,
DZONE, INC.
INC.
form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher.
SPONSORSHIP OPPORTUNITIES
DZONE.COM
DZONE.COM
sales@dzone.com
VERSION 1.0
$7.95