You are on page 1of 14

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/317637883

Microservices Architecture for Cloud Computing

Article · April 2016

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.

The user has requested enhancement of the downloaded file.


Journal of Information Technology and Sciences
Volume 2 Issue 1

Microservices Architecture for Cloud Computing

Vinod Keshaorao Pachghare


Department of Computer Engineering and Information Technology, College of Engineering, Pune,
India
E-mail: vkp.comp@coep.ac.in

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.

Keywords: Microservices, architecture, cloud, software, languages

INTRODUCTION computing allows increasing the


Microservices is emerges as a new popularity of the cloud. Use of
architecture, in which large and complex microservices offers more choices and
software applications are composed of options for independent evolve the service.
small one or more services. It can be In 2014, it emerges to speed up the process
deployed independently of one another. of development in mobile and web
These services are loosely coupled with applications [1, 2]. First, we discuss the
each other. Each of these microservices monolithic architecture and the issues
fare responsible for completing only one related with it. Then, we will discuss the
task with efficiently. Microservices are microservices architecture.
very useful for the applications in cloud
computing. Use of microservices in cloud

1 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

Monolithic resolved with the use of microservices


In this architecture, a single code is used architecture [3, 4].
for all the components of an application.
The entire application is based on a single Microservices
design and the complete application has to In this technique an individual application
be deployed. Individual components can be develop as a group of several small
cannot be deployed. But there are some services which are executing on their own
issues with monolithic applications. Some process. They communicate with
of these are as follows: mechanisms with less important such as an
 In monolithic application the code is HTTP resource API. These small services
large which makes it difficult to are constructing around business
understand. capabilities and they can deploy
 Scaling of this architecture is difficult. independently using deployment system
 Integration and deployment of the which is entirely automatic. The services
system are more complex and time are barely managed by a minimum
consuming. centralized system. These services are

 Due to the large size of code, the written in various programming languages.

Integrated Development Environment They use diverse technologies for data

(IDE) may be overloaded. This makes storage. In microservice architecture, small

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

 In monolithic architecture, every independently with potential of various

component is tightly coupled which developers using various languages across

makes it difficult to change the the globe [5, 6].

language, framework or technology.


LITERATURE REVIEW

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

Some of them are: emerging of new software architecture workshop near

technology, uninterrupted release, scaling Venice. The term microservice was

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

2 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

study at 33rd Degree in Krakow in Microservices are smaller in size and it


Microservices-Java, the Unix Way. In works on the policy of single
September 2012, microservice architecture responsibility principle [7, 8]. It struggles
was presented by Fred George at Baruco. for high cohesion and loose coupling and
Andrian Cockroft, for the first time, high cohesion which are the hallmarks of
applied this approach as fine-grained SOA. well-designed components.
Figure 1 illustrates the microservices
architecture. Standalone
A microservice is a standalone system. It
can work and execute autonomously.

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.

3 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

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

4 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

used to store the XML data. JSON is a Failure Isolation


syntax which allows storing and No service can execute 100% successfully.
exchanging the text data. It is a format If there is more number of services, then
used for text data interchange. It is smaller the chances of failure are more. For
in size than XML and faster and easier to example, there are three services which are
parse. It supports integration among communicating with each other. Suppose
various languages, and is also readable. Service A sends a request to Service B.
Therefore, it is the best choice for both Resulting this, Service B sends request to
internal and external communication Service C. If there is some failure at
between two services. Service C, so it can reply to Service B,
results in disruption of service to end
Testing users. Use of circuit breaker, timeouts, etc.
Integration testing is carried out to check can avoid the problem of service failure.
the proper working of code to confirm the
contracts among the services. But for more Service Discovery
number of services, it is difficult to write It is the model of separating how processes
these test cases. For such cases, it is and services find and communicate with
required to write a test related to users to each other. Service discovery problem in
identify the breakages in contract. To microservice is similar to that of the
verify the working after the production of service registry problem in service
results, the test cases are written for fake oriented architecture. In multiple services
request. environment, it is important to know the
other services which are required. In this
Deployment case, Domain Name System (DNS) with a
To deploy the services independent of load balancer can be used. But the
each other, for each service, it is necessary drawback of DNS is that it cannot scale
to have a single repository. Apply dynamically or elastically when the nodes
continuous delivery principles to assure are overloaded. Zookeeper is a centralized
that every modification in the service is service for maintaining information related
fabricated and tested. This also includes to configuration. These services offer
integration testing. distributed synchronization and group
services used by distributed applications.
Whenever, the services are executed, most

5 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

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

6 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

work independently and able to


communicate with each other using
messages. Also, they can replicate, migrate
or suspend to any resources. Number of
systems uses microservice concepts for
designing and implementation, for
example, Netflix.

Fig. 2: Scaling Comparisons between Microservice architecture can be

Monolith and Microservices. illustrated by matching it with the


approach of monolithic architecture as

COMPARISON BETWEEN shown in Figure 3. HTTP request is

MICROSERVICE handled by the monolithic application. It

AND MONOLITHIC also takes care of retrieve the data,

ARCHITECTURE executes the domain logic and updates the

Microservice architecture is a unique data in the database. It selects the HTML

technique for developing applications views which have to be sent to the

which have grown up in reputation in last browser. In monolithic application, a small

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

architecture supports a wide variety of modular structure of the application. This

devices and platforms. The microservice makes it difficult to modify or change a

architecture is most important for single module in the entire application.

developing an application in a cloud


environment. In this architecture, the entire
application is split into a number of small
services which are independent of each
other. Each of these small services is liable
for executing some specific feature. In a
Meta operating system, microservices
Fig. 3: Monolithic Architecture.
work as Meta processes. These processes

7 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

In microservice architecture, an capability to employ diverse technology,


application can be divided into multiple system resilience.
parts or components, called microservices.
These components are independently Drawbacks of Microservices
scaled. This architecture approach is very It also has some drawbacks. Some of them
useful when the system has very high load are: communication overhead,
with number of reusable modules. Figure 4 documentation overhead, diverse
illustrates microservice architecture. application, maintenance complexity and
more initial investment, enlarge
The microservice architectures are simple. communication, gathering the data,
It focuses on a single component at a time. security, testing and more monitoring cost.
The systems designed using microservice
architecture is loosely coupled as the COMMUNICATION MECHANISMS
components of a system work independent The communication prototype in
of each others. To execute the task, every microservice architecture between the
service is built, selecting the most suitable application and the client, as well as
tool. This architecture allows many teams among different components in the
and developers to work independent of application is different than that of a
each other using this architecture. monolithic application.

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,

8 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

mobile device makes a request for a single


service.

Fig. 5: Services Calling.


Fig. 6: API Gateway.
Above solution looks good but there may
be a considerable variance in granularity The API gateway uses LAN with high
between the APIs of the service and data performance network to handle the
requested by the clients. For example, to requests from clients. It makes the requests
display a single web page, it is necessary to different services available in
to call number of services (sometime more microservices architecture. It also
than 100 services). This so many requests summarizes the particulars of
use the bandwidth and lower its microservices due to which it develops
performance, and the mobile network may without affecting the clients. For
be inefficient, and results in poor examples, some microservices may be
performance. So, to avoid this bandwidth partitioned into multiple services or
consumption, clients should make a small multiple microservices may be merged to
number of requests per page. The approach get one microservice. For these
that supports this is known as API modifications, no changes are required at
gateway. Figure 6 illustrates this approach. client ends, only API should be updated.
In this approach, the API gateway is This communication among the
installed between the clients and the microservices is implemented using
microservices. API gateway offers a finer different mechanisms.
grained API to clients using desktop and a
coarse grained API to clients using mobile Inter-Service Communication
devices. In the following Figure given, the Mechanisms
client on desktop sends multiple requests The communication in the microservice
for various services, whereas a client from architecture depends on the interactions
among the various components. In a

9 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

monolithic application, regular techniques Resource is a main notion in REST. This


are used to communicate each other by the resource signifies an object, like product or
components. But there are different customer. HTTP is used by REST for
services, executing in different processes manipulating resources using a Uniform
in microservice architecture. As a result, Resource Locator (URL). For example, a
for the communication among the services ‘GET’ request sends a resource, which
in microservice architecture, it uses an may be an XML document or a JSON
Inter Process Communication (IPC). object.
Before selecting an inter-service
communication mechanism for a service, it Thrift
is beneficial to know the ways of An alternative to REST is Apache Thrift.
interactions of the services. Client and It is a framework which allows for writing
services interact with each other by cross language RPC servers and clients. It
different ways: one-to-one or one-to-many offers a C like IDL for defining APIs. User
and synchronous or asynchronous. In one- can use the Thrift compiler for creating
to-one mechanism, every request from skeletons for the server side and stubs for
client is processed by one instance. In one- the client side. It generates the code for
to-many mechanism, every request is different languages such as Java, C++,
processed by multiple instances. Another PHP, Python, Node.js and Ruby.
approach is synchronous HTTP or
Asynchronous messaging. Asynchronous Messaging
Another approach for communication is an
Synchronous HTTP asynchronous approach. It is based on
A synchronous communication approach message such as an AMQP-based message
based on HTTP like REST or SOAP is broker. It has number of advantages. Some
used for IPC. It can work easily across the of these are as follows:
network, and can be implemented easily.
But this approach has some limitations. It decouples producers from consumers of
the message. The messages are stored with
REST the message broker until the message
Representational State Transfer (REST) is consumer is ready to process the messages.
an inter-service communication Therefore, message producers do not have
mechanism which mostly uses HTTP. the complete information regarding the

10 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

message consumers. The message A publish subscribe channel distributes


producer has only to talk with the broker. every message to all relevant receivers.
It is not necessary to use a service These types of channels are used for one-
discovery mechanism. to-many communications by the services.
A point-to-point channel distributes a
It also supports publish-subscribe and one- message to only one receiver in the
way requests communication patterns. The channel. These types of channels are used
drawback of this system is the complexity for one-to-one communications by the
of the system is more due to use of a services. Figure 7 illustrates the working
message broker. of publish-subscribe channels.

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

11 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

a technique which allows developing an REFERENCES


individual application as a group of several 1. Cary Landis, Dan Blacharski. Cloud
small services. These services are computing made easy. 2010; ISBN:
executing on their own process. They 978-0-557-37495-3.
communicate with mechanisms with less 2. Barrie Sosinsky. Cloud computing
important such as an HTTP resource API. bible. Wiley Publishing; 2010.
Microservices offers better scalability as 3. Zaigham Mahmood, Thomas Erl,
compared to monolithic applications. Due Ricardo Puttini. Cloud computing,
to high scalability, microservices concepts, technology & architecture;
architecture supports for a wide variety of 2013.
devices and platforms. In microservice 4. Cary Landis, Dan Blacharski. Cloud
architecture, an application can be divided computing made easy. Virtual Global;
into multiple parts or components, called 2010.
microservices. These components are 5. Anthony T. Velte, Toby J. Velte,
independently scaled. This architecture Robert Elsenpeter. Cloud computing:
approach is very useful when the system A practical approach. McGraw-Hill;
has very high load with number of 2009.
reusable modules. The microservice 6. Rick E. Osowski. Microservices in
architectures are simple. It focuses on a action; 2015.
single component at a time. The systems 7. V. K. Pachghare. Cloud computing.
designed using microservice architecture is PHI Learning; 2016.
loosely coupled as the components of a 8. Galen Gruman, Alan Morrison.
system work independent of each others. Microservices: The resurgence of SOA
The communication among the services in principles and an alternative to the
microservice architecture uses an Inter monolith. Technology Forecast:
Process Communication (IPC). A Rethinking Integration: Emerging
synchronous communication approach Patterns from Cloud Computing
based on HTTP like REST or SOAP is Leaders. 2014; 1: 19–25P.
used for IPC. 9. Avaliable at:
http://cloudacademy.com/blog/microse
rvices-architecture-challenge-
advantage-drawback.

12 Page 1-13 © MAT Journals 2016. All Rights Reserved


Journal of Information Technology and Sciences
Volume 2 Issue 1

10. Avaliable at: 11. Avaliable at:


http://www.ibm.com/developerworks/c https://www.pwc.com/us/en/technolog
loud/library/cl-microservice- y-forecast/2014/cloud-
architecture-bluemix-cloud-foundry- computing/features/assets/pwc-
apps-trs-1/. microservices.pdf.

13 Page 1-13 © MAT Journals 2016. All Rights Reserved

View publication stats

You might also like