SlideShare a Scribd company logo
1 of 12
Microservice Architecture
Best Practices
Aliasgar Muchhala
May 2017
E
2Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
App ServerApp ServerApp ServerApp Server
.WAR /.EAR
What is Microservices Architecture?
Microservice Architecture advocates creating a system from a collection of small, isolated services,
each of which owns its data and is independently isolated, scalable and resilient to failure.
Design
Build
Test
Deploy
App Design Build Test Deploy
Design Build Test Deploy
Design Build Test Deploy
Design Build Test Deploy Service
Service
Service
Service
Search OrderCart Admin
Database
Monolith Microservice
App Server
.WAR /.EAR
DB DB DB DB
.WAR /.EAR .WAR /.EAR .WAR /.EAR
Search OrderCart Admin
Developers Developers
Developers
Developers
Developers
3Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Micro services architecture extends the “functional decomposition” concept of SoA to the
deployment architecture.
Microservices vs. SOA
 The functional decomposition concept of Microservices is
not new; it existed well before SOA
 SOA also was based on the concept of functional
decomposition , However this decomposition was
implemented only at the logical architecture level, not all the
way to the packaging and deployment architecture level
 Not that SOA was against the principle of physical isolation.
But some of the technical constraints that prevailed then,
(example lead time required to provision a new server in an
environment, following bureaucratic sequential process of
advancing code changes to a higher environment, etc.) did
not seem like a very viable option.
 However today with technologies such as Cloud, DevOps
and Containerization, it makes perfect sense to take the
functional decomposition all the way to deployment
architecture so as to create smaller independently
deployable apps, and hence Microservice Architecture is an
obvious choice in todays world.
CONTAINERS
SOA
Microservices
4Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Isolation at every layer in a Microservices Architecture
 We talked about the logical separation of the
application architecture which was predominant in
SOA already
 We also discussed about the physical isolation in the
deployment architecture, which leads to breaking a
monolith into smaller independent microservices.
 However traditionally these services still end up
talking to the same, single, unified, data store for that
app; which still introduces data-led inter-
dependencies within your app.
 Microservice Architecture mandates that each service
persists it’s own data in its own data store.
 This requires very careful consideration at the very
early stages of the project, following the bounded
context pattern of Domain Driven Designs!
 Microservice architecture proposes building services
that are truly isolated and autonomous
App Server
.WAR /.EAR
DB DB DB DB
.WAR /.EAR .WAR /.EAR .WAR /.EAR
Search OrderCart Admin
Isolation at the Data Layer
Isolation at the Deployment Layer
Isolation in the Logical Architecture
Isolation is the most important aspect of Microservice Architecture…
…and is also the aspect that has maximum impact on your application!
Isolation makes the Microservices scaleable
5Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Granularity of Microservices… What can be considered “Micro”?
 Size in a software world is often referred to in
terms of “Lines Of Code”.
 So when MicroService Architecture talks of
breaking down a monolith into “smaller”
microservices, the obvious questions that are
often raised are : “Up to how many lines of code
can be in a Microservice?” “How small is
considered as “Micro”?
 These however are definitely NOT the right
questions to ask. Although the name might
suggest so, microservices have almost nothing to
do with its size. Its more a matter of it being
responsible for ONLY one function.
 The two-pizza rule for a team working on a
microservice is often a good indicator.
Size does(n’t) matter!!
Single Responsibility Principle matters!!
6Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Scalability & Elasticity of Microservices
 Elasticity is a key ask of microservices, as that will
maximize its leverage of the underlying cloud
platform.
 It is important that a microservice is designed such
that it does not leave behind any residual state
after each execution – they need to be stateless.
This ensures that the services can be scaled down
as easily as they are scaled up.
 In case of stateful microservices, it is important
that they either leverage the native persistent
storage services offered by the platform OR
leverages tools like Flocker that allow the
persistent storage to be containerized.
Scalability refers to the ability to increase the workload by provisioning additional resources
Elasticity refers to the ability to also “release” additional resources as workload reduces
7Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
How do you build a “real” Business Service?
 Traditional SOA typically implemented business
services by “orchestrating” between a number of “core”
domain services , so as to achieve the desired
business outcome.
 This is feasible in the monolith world as the core
services are typically still packaged within the same
app (so no remote calls involved), In case of
microservices, the cumulative network calls can
increase the response times significantly.
 Microservice Architecture recommends a more
asynchronous based “choreography of services”
approach as opposed to “orchestration” of services
 Microservices behave as smart endpoints on a dumb
pipe, and the async messages “flowing” through the
pipe will be picked up by appropriate microservices
based on the message context.
Communication between Microservices needs to be based on Asynchronous Message-Passing
This requires a robust distributed messaging platform
Request
Response
100
ms
100
ms
100
ms
100
ms
Service1 Service2 Service3 Service4
200 ms100 ms 400 ms300 ms
400 ms
Request Response
100
ms
100
ms
100
ms
100
ms
Message Queue
Service1 Service2 Service3 Service4
Response
Composition
 In the case of choreography, Since the services are executed in parallel, the consolidated response needs to be
composed. This is typically done by API gateway or in more data intensive scenarios by Lamda algorithms.
Choreography
Orchestration
8Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
eCommerce App
No Technology Debt in a Polyglot Environment
Cart
DB DB DB DB
Search Admin Order
 In a traditional monolith application, the existing
technology landscape of the app dictates the
technology selection for any new functionality
added to it as well. This is known as technology
debt.
 However, with Microservice Architecture, since
each independent functionality gets packaged as a
separate independent application, there is no
binding to use ONLY a specific technology.
 Each microservice can be developed using the
technology which is perceived as the best choice
for that functionality. This gives rise to a polyglot
architecture, where in every microservice could
potentially be different.
Microservice Architecture enables a Polyglot Architecture
9Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Knowing how your Microservices are doing
 Microservices Architecture recommends
implementing a comprehensive monitoring
and alerting platform that “watches” all your
APIs
 This allows you to better leverage the
underlying cloud platform to scale and heal
your apps more efficiently.
 This gives you better control and inturn
ensures higher availability of your application
 Monitoring involves not only hardware level
parameters (CPU, memory, disk, etc.) but
also service parameters (response times,
num of invocations, etc.)
Sooner a problem is detected, lesser the cost to fix it!
10Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
Knowing where your Microservices are
 Microservices Architecture enables building multiple smaller APIs
that can be easily scaled independently of each other. The
challenge however is, As we throw in newer instances of the APIs,
how do they locate each other?
 To address this problem, microservice architecture strongly
recommends the inclusion of a service discovery & routing layer
that comprises of :
 API gateway that is responsible for routing of service requests,
 Service Discovery that is responsible of tracking “available” API
instances.
 Together, they ensure that every request is routed to an instance
that is available and can process it without any issues
 Often, the API gateway also takes the responsibility of service
composition.
It’s a dynamic world out there… Need someone to help a request get to where it needs to!
11Copyright © Capgemini 2014. All Rights Reserved
March 2017 | Cloud TLI
So are the ESBs no longer needed?
 Microservices are functional decomposition of an
application. We would still use the microservice
architecture best practices (slide 7) to get these
microservices to talk to each other.
 However, when these need to integrate with
“other” applications (usually external APIs) , we
are referring to EAI for which an ESB is very
much required.
 ESBs apply when integrating across enterprise
applications, where as microservices are just
applied at inter-application level.
 It is very common to see both, traditional SOA
based ESBs co-exist with microservice
architectures in an enterprise landscape.
Microservices Architecture applies at the “intra-Application” layer…
….ESBs are used at the “inter-Application” layer
Enterprise Service Bus
App
6
App
5
App
4
App
1
App
2
App
3
Microservice Architecture for App 3
.WAR /.EAR
DB DB DB DB
.WAR /.EAR .WAR /.EAR .WAR /.EAR
Search OrderCart Admin
EAIusinganESB
The information contained in this presentation is proprietary.
© 2014 Capgemini. All rights reserved.
www.capgemini.com
About Capgemini
With more than 130,000 people in 44 countries, Capgemini is one
of the world's foremost providers of consulting, technology and
outsourcing services. The Group reported 2012 global revenues
of EUR 10.3 billion.
Together with its clients, Capgemini creates and delivers
business and technology solutions that fit their needs and drive
the results they want. A deeply multicultural organization,
Capgemini has developed its own way of working, the
Collaborative Business Experience™, and draws on Rightshore®,
its worldwide delivery model.
Rightshore® is a trademark belonging to Capgemini

More Related Content

What's hot

What's hot (20)

Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
Infrastructure as Code: AWS Best Practices (DEV411-R3) - AWS re:Invent 2018
 
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
Microservice Architecture | Microservices Tutorial for Beginners | Microservi...
 
Microservices Design Patterns | Edureka
Microservices Design Patterns | EdurekaMicroservices Design Patterns | Edureka
Microservices Design Patterns | Edureka
 
Microservices
MicroservicesMicroservices
Microservices
 
The Need of Cloud-Native Application
The Need of Cloud-Native ApplicationThe Need of Cloud-Native Application
The Need of Cloud-Native Application
 
Azure DevOps & GitHub... Better Together!
Azure DevOps & GitHub... Better Together!Azure DevOps & GitHub... Better Together!
Azure DevOps & GitHub... Better Together!
 
AWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptxAWS VS AZURE VS GCP.pptx
AWS VS AZURE VS GCP.pptx
 
Observability, what, why and how
Observability, what, why and howObservability, what, why and how
Observability, what, why and how
 
Introduction to Google Cloud Platform
Introduction to Google Cloud PlatformIntroduction to Google Cloud Platform
Introduction to Google Cloud Platform
 
Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
 
Executing a Large-Scale Migration to AWS
Executing a Large-Scale Migration to AWSExecuting a Large-Scale Migration to AWS
Executing a Large-Scale Migration to AWS
 
Improve monitoring and observability for kubernetes with oss tools
Improve monitoring and observability for kubernetes with oss toolsImprove monitoring and observability for kubernetes with oss tools
Improve monitoring and observability for kubernetes with oss tools
 
Cloud-Native Observability
Cloud-Native ObservabilityCloud-Native Observability
Cloud-Native Observability
 
Dynatrace: New Approach to Digital Performance Management - Gartner Symposium...
Dynatrace: New Approach to Digital Performance Management - Gartner Symposium...Dynatrace: New Approach to Digital Performance Management - Gartner Symposium...
Dynatrace: New Approach to Digital Performance Management - Gartner Symposium...
 
Azure Arc by K.Narisorn // Azure Multi-Cloud
Azure Arc by K.Narisorn // Azure Multi-CloudAzure Arc by K.Narisorn // Azure Multi-Cloud
Azure Arc by K.Narisorn // Azure Multi-Cloud
 
Using Azure DevOps to continuously build, test, and deploy containerized appl...
Using Azure DevOps to continuously build, test, and deploy containerized appl...Using Azure DevOps to continuously build, test, and deploy containerized appl...
Using Azure DevOps to continuously build, test, and deploy containerized appl...
 
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
ABD318_Architecting a data lake with Amazon S3, Amazon Kinesis, AWS Glue and ...
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
Azure DevOps in Action
Azure DevOps in ActionAzure DevOps in Action
Azure DevOps in Action
 
How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 

Similar to Microservices Best Practices

Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptxChapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
JerianMacatuggal
 

Similar to Microservices Best Practices (20)

Cloud Native Architecture: Its Benefits and Key Components
Cloud Native Architecture: Its Benefits and Key ComponentsCloud Native Architecture: Its Benefits and Key Components
Cloud Native Architecture: Its Benefits and Key Components
 
Exploring Cloud Native Architecture: Its Benefits And Key Components
Exploring Cloud Native Architecture: Its Benefits And Key ComponentsExploring Cloud Native Architecture: Its Benefits And Key Components
Exploring Cloud Native Architecture: Its Benefits And Key Components
 
Whitepaper : Microservices In or Out
Whitepaper : Microservices   In or OutWhitepaper : Microservices   In or Out
Whitepaper : Microservices In or Out
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft Microservices
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHYSELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
 
Unveiling the Advantages and Core Elements of Cloud Native Architecture
Unveiling the Advantages and Core Elements of Cloud Native ArchitectureUnveiling the Advantages and Core Elements of Cloud Native Architecture
Unveiling the Advantages and Core Elements of Cloud Native Architecture
 
Microservices oracle-meetup
Microservices oracle-meetupMicroservices oracle-meetup
Microservices oracle-meetup
 
Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptxChapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
Chapter VI -CLOUD NATIVE AND EMERGENT TRENDS.pptx
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...
 
Information on Cloud-native Applications
Information on Cloud-native ApplicationsInformation on Cloud-native Applications
Information on Cloud-native Applications
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with mule
 
Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...
 
Microservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdfMicroservice Best Practices The 8020 Way.pdf
Microservice Best Practices The 8020 Way.pdf
 
Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...Architecting for speed: how agile innovators accelerate growth through micros...
Architecting for speed: how agile innovators accelerate growth through micros...
 
Why Microservice
Why Microservice Why Microservice
Why Microservice
 
Microservices Design Principles.pdf
Microservices Design Principles.pdfMicroservices Design Principles.pdf
Microservices Design Principles.pdf
 
CWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der walCWIN17 Utrecht / cg u services - frank van der wal
CWIN17 Utrecht / cg u services - frank van der wal
 
Microservices vs Monolithic Architecture: Which Approach is Suitable for a St...
Microservices vs Monolithic Architecture: Which Approach is Suitable for a St...Microservices vs Monolithic Architecture: Which Approach is Suitable for a St...
Microservices vs Monolithic Architecture: Which Approach is Suitable for a St...
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Microservices Best Practices

  • 2. 2Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI App ServerApp ServerApp ServerApp Server .WAR /.EAR What is Microservices Architecture? Microservice Architecture advocates creating a system from a collection of small, isolated services, each of which owns its data and is independently isolated, scalable and resilient to failure. Design Build Test Deploy App Design Build Test Deploy Design Build Test Deploy Design Build Test Deploy Design Build Test Deploy Service Service Service Service Search OrderCart Admin Database Monolith Microservice App Server .WAR /.EAR DB DB DB DB .WAR /.EAR .WAR /.EAR .WAR /.EAR Search OrderCart Admin Developers Developers Developers Developers Developers
  • 3. 3Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Micro services architecture extends the “functional decomposition” concept of SoA to the deployment architecture. Microservices vs. SOA  The functional decomposition concept of Microservices is not new; it existed well before SOA  SOA also was based on the concept of functional decomposition , However this decomposition was implemented only at the logical architecture level, not all the way to the packaging and deployment architecture level  Not that SOA was against the principle of physical isolation. But some of the technical constraints that prevailed then, (example lead time required to provision a new server in an environment, following bureaucratic sequential process of advancing code changes to a higher environment, etc.) did not seem like a very viable option.  However today with technologies such as Cloud, DevOps and Containerization, it makes perfect sense to take the functional decomposition all the way to deployment architecture so as to create smaller independently deployable apps, and hence Microservice Architecture is an obvious choice in todays world. CONTAINERS SOA Microservices
  • 4. 4Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Isolation at every layer in a Microservices Architecture  We talked about the logical separation of the application architecture which was predominant in SOA already  We also discussed about the physical isolation in the deployment architecture, which leads to breaking a monolith into smaller independent microservices.  However traditionally these services still end up talking to the same, single, unified, data store for that app; which still introduces data-led inter- dependencies within your app.  Microservice Architecture mandates that each service persists it’s own data in its own data store.  This requires very careful consideration at the very early stages of the project, following the bounded context pattern of Domain Driven Designs!  Microservice architecture proposes building services that are truly isolated and autonomous App Server .WAR /.EAR DB DB DB DB .WAR /.EAR .WAR /.EAR .WAR /.EAR Search OrderCart Admin Isolation at the Data Layer Isolation at the Deployment Layer Isolation in the Logical Architecture Isolation is the most important aspect of Microservice Architecture… …and is also the aspect that has maximum impact on your application! Isolation makes the Microservices scaleable
  • 5. 5Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Granularity of Microservices… What can be considered “Micro”?  Size in a software world is often referred to in terms of “Lines Of Code”.  So when MicroService Architecture talks of breaking down a monolith into “smaller” microservices, the obvious questions that are often raised are : “Up to how many lines of code can be in a Microservice?” “How small is considered as “Micro”?  These however are definitely NOT the right questions to ask. Although the name might suggest so, microservices have almost nothing to do with its size. Its more a matter of it being responsible for ONLY one function.  The two-pizza rule for a team working on a microservice is often a good indicator. Size does(n’t) matter!! Single Responsibility Principle matters!!
  • 6. 6Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Scalability & Elasticity of Microservices  Elasticity is a key ask of microservices, as that will maximize its leverage of the underlying cloud platform.  It is important that a microservice is designed such that it does not leave behind any residual state after each execution – they need to be stateless. This ensures that the services can be scaled down as easily as they are scaled up.  In case of stateful microservices, it is important that they either leverage the native persistent storage services offered by the platform OR leverages tools like Flocker that allow the persistent storage to be containerized. Scalability refers to the ability to increase the workload by provisioning additional resources Elasticity refers to the ability to also “release” additional resources as workload reduces
  • 7. 7Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI How do you build a “real” Business Service?  Traditional SOA typically implemented business services by “orchestrating” between a number of “core” domain services , so as to achieve the desired business outcome.  This is feasible in the monolith world as the core services are typically still packaged within the same app (so no remote calls involved), In case of microservices, the cumulative network calls can increase the response times significantly.  Microservice Architecture recommends a more asynchronous based “choreography of services” approach as opposed to “orchestration” of services  Microservices behave as smart endpoints on a dumb pipe, and the async messages “flowing” through the pipe will be picked up by appropriate microservices based on the message context. Communication between Microservices needs to be based on Asynchronous Message-Passing This requires a robust distributed messaging platform Request Response 100 ms 100 ms 100 ms 100 ms Service1 Service2 Service3 Service4 200 ms100 ms 400 ms300 ms 400 ms Request Response 100 ms 100 ms 100 ms 100 ms Message Queue Service1 Service2 Service3 Service4 Response Composition  In the case of choreography, Since the services are executed in parallel, the consolidated response needs to be composed. This is typically done by API gateway or in more data intensive scenarios by Lamda algorithms. Choreography Orchestration
  • 8. 8Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI eCommerce App No Technology Debt in a Polyglot Environment Cart DB DB DB DB Search Admin Order  In a traditional monolith application, the existing technology landscape of the app dictates the technology selection for any new functionality added to it as well. This is known as technology debt.  However, with Microservice Architecture, since each independent functionality gets packaged as a separate independent application, there is no binding to use ONLY a specific technology.  Each microservice can be developed using the technology which is perceived as the best choice for that functionality. This gives rise to a polyglot architecture, where in every microservice could potentially be different. Microservice Architecture enables a Polyglot Architecture
  • 9. 9Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Knowing how your Microservices are doing  Microservices Architecture recommends implementing a comprehensive monitoring and alerting platform that “watches” all your APIs  This allows you to better leverage the underlying cloud platform to scale and heal your apps more efficiently.  This gives you better control and inturn ensures higher availability of your application  Monitoring involves not only hardware level parameters (CPU, memory, disk, etc.) but also service parameters (response times, num of invocations, etc.) Sooner a problem is detected, lesser the cost to fix it!
  • 10. 10Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI Knowing where your Microservices are  Microservices Architecture enables building multiple smaller APIs that can be easily scaled independently of each other. The challenge however is, As we throw in newer instances of the APIs, how do they locate each other?  To address this problem, microservice architecture strongly recommends the inclusion of a service discovery & routing layer that comprises of :  API gateway that is responsible for routing of service requests,  Service Discovery that is responsible of tracking “available” API instances.  Together, they ensure that every request is routed to an instance that is available and can process it without any issues  Often, the API gateway also takes the responsibility of service composition. It’s a dynamic world out there… Need someone to help a request get to where it needs to!
  • 11. 11Copyright © Capgemini 2014. All Rights Reserved March 2017 | Cloud TLI So are the ESBs no longer needed?  Microservices are functional decomposition of an application. We would still use the microservice architecture best practices (slide 7) to get these microservices to talk to each other.  However, when these need to integrate with “other” applications (usually external APIs) , we are referring to EAI for which an ESB is very much required.  ESBs apply when integrating across enterprise applications, where as microservices are just applied at inter-application level.  It is very common to see both, traditional SOA based ESBs co-exist with microservice architectures in an enterprise landscape. Microservices Architecture applies at the “intra-Application” layer… ….ESBs are used at the “inter-Application” layer Enterprise Service Bus App 6 App 5 App 4 App 1 App 2 App 3 Microservice Architecture for App 3 .WAR /.EAR DB DB DB DB .WAR /.EAR .WAR /.EAR .WAR /.EAR Search OrderCart Admin EAIusinganESB
  • 12. The information contained in this presentation is proprietary. © 2014 Capgemini. All rights reserved. www.capgemini.com About Capgemini With more than 130,000 people in 44 countries, Capgemini is one of the world's foremost providers of consulting, technology and outsourcing services. The Group reported 2012 global revenues of EUR 10.3 billion. Together with its clients, Capgemini creates and delivers business and technology solutions that fit their needs and drive the results they want. A deeply multicultural organization, Capgemini has developed its own way of working, the Collaborative Business Experience™, and draws on Rightshore®, its worldwide delivery model. Rightshore® is a trademark belonging to Capgemini

Editor's Notes

  1. Need to read more about how Flocker works
  2. Other points to cover : * Serverless architecture * Containerization