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

Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...ITSM Academy, Inc.
 
Product Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformProduct Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformMuleSoft
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices Amazon Web Services
 
A Practical Guide to Scaling Agile
A Practical Guide to Scaling AgileA Practical Guide to Scaling Agile
A Practical Guide to Scaling AgileMariya Breyter
 
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...apidays
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Benefits of integration with the Mulesoft Anypoint Platform
Benefits of integration with the Mulesoft Anypoint PlatformBenefits of integration with the Mulesoft Anypoint Platform
Benefits of integration with the Mulesoft Anypoint PlatformCloud Analogy
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyWSO2
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudNew Relic
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Animesh Singh
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1SmartBear
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Kai Wähner
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice ArchitectureWSO2
 

What's hot (20)

API Governance
API Governance API Governance
API Governance
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
Site Reliability Engineering: An Enterprise Adoption Story (an ITSM Academy W...
 
Product Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint PlatformProduct Vision and Roadmap for Anypoint Platform
Product Vision and Roadmap for Anypoint Platform
 
From Monolithic to Microservices
From Monolithic to Microservices From Monolithic to Microservices
From Monolithic to Microservices
 
A Practical Guide to Scaling Agile
A Practical Guide to Scaling AgileA Practical Guide to Scaling Agile
A Practical Guide to Scaling Agile
 
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...
Apidays Paris 2023 - 7 Mistakes When Putting In Place An API Program, Francoi...
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Benefits of integration with the Mulesoft Anypoint Platform
Benefits of integration with the Mulesoft Anypoint PlatformBenefits of integration with the Mulesoft Anypoint Platform
Benefits of integration with the Mulesoft Anypoint Platform
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management StrategyArchitecting an Enterprise API Management Strategy
Architecting an Enterprise API Management Strategy
 
Apigee Products Overview
Apigee Products OverviewApigee Products Overview
Apigee Products Overview
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
 
Zero-Trust SASE DevSecOps
Zero-Trust SASE DevSecOpsZero-Trust SASE DevSecOps
Zero-Trust SASE DevSecOps
 
Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1Introducing OpenAPI Version 3.1
Introducing OpenAPI Version 3.1
 
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...Open API and API Management - Introduction and Comparison of Products: TIBCO ...
Open API and API Management - Introduction and Comparison of Products: TIBCO ...
 
APIs in a Microservice Architecture
APIs in a Microservice ArchitectureAPIs in a Microservice Architecture
APIs in a Microservice Architecture
 

Similar to Microservices Best Practices

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 ComponentsAndrewHolland58
 
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 ComponentsLucy Zeniffer
 
Microsoft Microservices
Microsoft MicroservicesMicrosoft Microservices
Microsoft MicroservicesChase Aucoin
 
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 IJwest
 
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. CHOREOGRAPHYdannyijwest
 
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 ArchitectureTechugo
 
Microservices oracle-meetup
Microservices oracle-meetupMicroservices oracle-meetup
Microservices oracle-meetupNitu Parimi
 
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.pptxJerianMacatuggal
 
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...Kim Clark
 
Information on Cloud-native Applications
Information on Cloud-native ApplicationsInformation on Cloud-native Applications
Information on Cloud-native ApplicationsHTS Hosting
 
Microservices with mule
Microservices with muleMicroservices with mule
Microservices with muleGovind Mulinti
 
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...3gamma
 
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.pdfSimform
 
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...Jesper Nordström
 
Microservices Design Principles.pdf
Microservices Design Principles.pdfMicroservices Design Principles.pdf
Microservices Design Principles.pdfSimform
 
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 walCapgemini
 
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...Shelly Megan
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architectureTouraj Ebrahimi
 

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

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Recently uploaded (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

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