Microservices Architecture
Microservices Architecture
net/publication/317637883
CITATIONS READS
7 15,393
1 author:
Vinod Pachghare
College of Engineering, Pune
79 PUBLICATIONS 839 CITATIONS
SEE PROFILE
All content following this page was uploaded by Vinod Pachghare on 02 August 2018.
Abstract
As the new trends in various areas are emerged day by day, the new architecture for various
applications is evolving. There is a demand from users for interactive, rich and dynamic
experience on various platforms. These demands are satisfied by the applications having high
availability, scalability and easy-to-execute on cloud platform. Most of the organizations
want to update their applications frequently, several times a day. Monolithic applications
have the limitation to support such demands. In this paper, we discuss the architecture called
microservices, which can support to achieve above requirements. The applications with this
new architecture have multiple services which can deploy independently. These services
focus on a minor part of the applications. Microservices provide scalability and agility to the
applications.
Due to the large size of code, the written in various programming languages.
the IDE slow and increases in the time services which are autonomous and that
for building the application. work together can be scaled and released
Besides, above issues of monolithic The term microservice, for the first time,
applications, it also has some challenges. was used in May, 2011 in a discussion at a
problem, many teams and addition of new recognized by the same people in May,
members. These issues challenges can be 2012. In March 2012, some of these ideas
are presented by James Lewis as a case
Easy Integrations
It allows integrating the microservices
using well-known open protocols,
Fig. 1: Microservices Architecture.
interfaces and standards. It offers
heterogeneity of technology, therefore,
CHARACTERISTICS OF
developer teams can use the stack of
MICROSERVICES
technology, which is best suited and
The Microservices architecture has
comfortable to the applications.
following characteristics.
ATTRIBUTES OF MICROSERVICES
Autonomous
Componentization as a Service
In this architecture, every service is
It builds a customized service by using
developed using a suitable tool. There are
some specific components together.
many developer teams working
independently. There is a data storage
Organized around Business Capabilities
owned by every microservice.
IT isolates the potentials for some specific
areas like interface with user and external
Modelled around the Business Domain
integrations.
To offer fast delivery of goals of the
business, microservices are aligned
Development based on Products
vertically that with business potential.
The developers use the same software
Size
throughout the life-time of the product.
Smart Endpoints and Dumb Pipes into smaller parts by identifying the
Every microservice is as isolated as suitable service boundaries (physical as
possible with the logic of its own domain well as logical) among different parts. This
logic. boundary selection is the major challenge.
Domain Driven Design (DDD) provides a
Decentralized Control suitable solution to identify the boundary
It allows the developers to select the and break the system. One more challenge
language of their choice for the for dividing the system is how to split the
development of each component. state. Database is the state for most of the
applications. In this case, the present
Data Management Decentralization database can be divided so that it can
Each microservice is able to label and can denormalize into one source of data per
handle the data in a different way. table. Also, one can establish the
relationships of foreign key and
Automation of Infrastructure transactions between two mocroservices.
It is possible to deploy the pipeline
automatically. Communication between Two Services
It is very important to select the
Recovery from Failure appropriate method of communication
It is always prepared to recover from among the microservices. For
failure [9, 10]. asynchronous and
synchronous communication, Representati
MIGRATION TO MICROSERVICES n State Transfer (REST) is a good option
While changes the architecture and over HTTP. For payloads, one can use
migrating to microservices, it is essential Binary, eXtensible Markup Language
to investigate multiple design features. (XML) or JSON (JavaScript Object
Also, before adopting the microservices, Notation). Use of binary protocols like
one should understand the benefits and Protobuff, Avro or Thrift gives
drawbacks of different approaches. considerable performance for internal
services. In HTML, every time the data is
Divide the Monolith modified. Lot of work is required to edit
To migrate towards the microservice, it is the HTML. XML allows to store and
necessary to divide the monolith system transport data easily. The XML files are
of the effort required for identifying the people do not know the details about the
bugs which are inevitable. Therefore, service, then nobody adopts your service.
Zookeeper is a good option as it offers the
primitives to construct a service discovery API Gateway
solution. Consul is another solution. It is a API Gateway offers a method to handle
service discovery implementation built by the issues related to transport security,
Hashicorp. It provides all the required transport transformations, authentication,
information for service discovery out of load-balancing, dependency resolution and
the box. request dispatching. API Gateway can be
used to compose one or two microservices.
Monitoring This offers a diverse granularity for users.
When there are number of services
communicating with each other, there is a Microservices offer better scalability as
need of understanding the behavior of the compared to monolithic applications. To
system and issues related to the scale the monolithic application, all the
performance. For this monitoring, some components of an application have to be
tools are required. To get the unified view scaled. To scale a single component of
of different systems, aggregation is very monolithic application, all the components
important. Tools like Splunk or Logstash have to be scaled. This is the drawback of
can be used for this purpose. Splunk tool monolith architecture, because we have to
offers a wide range of log management waste the resources and this also increases
support for log consolidation and the complexity. But in microservices, we
retention. LogStash offers architecture for can scale only those components of an
collecting, parsing and storing logs in application which we want to scale instead
microservices architecture. When multiple of all the components. Therefore, scaling
services are involved, the required in microservices is easier than monolith.
visibility is provided by the distributed Figure 2 illustrates the scaling in monolith
request tracing [11]. and microservices.
Documentation
Proper documentation is very important
for the widespread use of services. If
few years. Many application developers change in the design results in to redesign
adopt it as a first choice for creating their and deploy the entire monolith. Therefore,
applications. Due to high scalability, this it is difficult to preserve the design and
API Gateway
In a monolithic, the browsers (client) and
applications send HTTP requests using a
load balancer to the identical instance of
the application. But in a microservice, the
Fig. 4: Microservice Architecture. set of services replaces the monolith.
Suppose the application on the mobile
Benefits of Microservices device is a client. This client sends request
It offers many benefits to the developers. RESTful HTTP to some specific services
Some of the most common benefits are as as illustrated in Figure 5.
follows: Code is small and easy to
understand, easy to scale, smaller teams,
easy to throw away, easy to deploy,
Asynchronous Message-based
Communication
In asynchronous message-based
communication, processes communicate
with each other by asynchronously
exchanging the messages. A request by a Fig. 7: Publish-Subscribe Channels.
client to a service is done by sending a
message. If the reply is expected, then the CONCLUSION
service sends a separate message to the In monolithic architecture, there is a single
client. As asynchronous communication code for all the components of an
method is used without waiting for the application. The entire application is based
reply from the server, client continues his on a single design and the complete
message transmission assuming that the application has to be deploy, not the
reply will come later on. Channels are individual components. But there are some
used for the exchange of messages. There issues with monolithic applications. To
may be any numbers of message senders resolve these issues, one can use
and receivers who can use the same microservices. In this, small services
channel. A message consists of headers which are autonomous and that work
and a message body. Channels are of two together can be scaled and released
types: publish subscribe and point-to- independently with potential of various
point. developers using various languages across
the globe. The microservice architecture is