SlideShare a Scribd company logo
Microservices
Practicalities and Things to watch out for
Parthiban J
https://www.linkedin.com/in/parthibanj-ea/
What is Micro services ?
Framework ?
Deployment model ?
Architectural Pattern ?
Obviously ,
Microservices is not a
silver bullet and is not
the only way to architect
applications
The Difference
• Tightly coupled
• Scaling is an issue
• Functionality as services
• Must fit into overall design
• Rules and protocols govern
communication
• Loosely coupled
• Bounded context
• Scalable
• What you expose to consumers
• Could be a single service or a
collection
Monolith SOA Microservices API
Why Microservices
• Deploy individually without impacting other
services
• Independent deployment = Quicker time to
market
• Selective scaling
• Fault Isolation
The Ecosystem
Composition
DB
Architecture
Service
Definition
Service
Registry
Service
Discovery
Deployment
Security
Composition – Decompose by business capability, by sub domain
DB Architecture – Dedicate DB per service, Shared DB
Service Definition – Contract definition
Service Registry – Self Registry, Third Party
Service Discovery – Client side, Server side
Deployment – VM, Containers, Serverless
Security – API Gateway, Tokens
The First step – Identifying your services
Domain driven design (DDD)
Entity
outside
domain
Inventory
Order Product
Customer Order History Price
…… …….
Your Domain
Define & use integration
channels for external
communications
Sub Domain
• Domain = Your problem space , your scope
• DDD -> Break your complex problem into sub
domains
• Identify : Entities, interactions and their
boundaries
• Bounded context
• Define rules of interactions and place the
ownership of management appropriately
Tips - Building a service catalogue
• Focus on single responsibility - service must do one
thing and only one thing
• Fine Vs Coarse grain -> Transaction block sizes must
be manageable
Dedicated Vs Shared DB
• Segregated ownership
• Cross references Vs Data Redundancy Vs Scalability
considerations
• Data Sync – Changelogs, events , pull
Ordering DB
Ordering Customers Sales
Customer
DB
Sales DB
Dedicated DB ( Preferred )
Shared DB
Ordering Customers Sales
Shared DB (Trade Off )
• Will work, but must be cautious about responsibility segregation
• Multiple schemas within a same DB is an option
• Always keep selective scaling and change management in mind
Transaction Management
CAP Theorem – You can have just 2 and not all 3
Eventual Consistency
• Will have to move from strict to eventual consistency
• Can be implemented in 2 ways :
• 2 Phased commit
• Prepare phase
• Commit phase
• SAGA pattern
• Choreography
• Orchestration
Consistency
Querying
• CRUD vs CQRS
• Traditional CRUD – Create, Read, Update, Delete model
• CQRS - Command Query Responsibility Segregation
• 2 Different models for Write and Read
• Command – Create / Update transactions
• Query – Read
Service Definition
Reasons why you must have a contract
• Let the world know what the service is about
• Document your service contract – Input & output
• Use : RAML, Swagger or any tool
• Some tools let you generate code from contract definitions.. Yay !
• You can even write test automation scripts from contract
Hey world am here
This is how you reach me
Service Registry
Self Registry
Third Party
Service Registry
Service
Registry
RegistrarHeartbeat
(De)Register
Heartbeat
Register
• Service instances are responsible for registering and deregistering
• Pro : Does not need other components to manage registrations
• Con : Every service / framework used must implement a registering
mechanism
• “Registrar” component manages service registration. Many
deployment environments have service registration inbuilt
• Pro : Do not have to implement the registration per
implementation language and framework
• Con : Registrar is one more component to manage and assure
availability
Service Discovery
• Client queries registry and is responsible for load balancing
• E.g Ribbon – load balancer
• Client just calls a DNS URL.
• E.g AWS elastic load balancer (ELB)
Client Side Server Side
Service
Registry
Service
Service
Service
Client
Service
Registry
Service
Service
Service
Client
Load Balancer
Deployment models
Deploy them on a traditional VM as
multiple instances
Deploy them on a dedicated VMs
Of course, You can deploy them as
containers
Serverless, Yay !! Why not
Security – Gateways and Tokens
API
Gateway
Security
Routing
API mgmt.
Audit
……
S1
S3
S2
S4
Client 1
Client 2
Client 3
API Gateway Vs Service registry – Most API gateways have inbuilt integration
to registries
API Gateway Vs Service mesh – Mesh is a network communication
infrastructure. Circuit breaker, fault injection, health check
Client 1
Client 2
Client 3
Design Goal : Stateless
Knowing State: Stick sessions, session replication
Tokens : JWT, OAuth
Other things to consider
Service Segregation Audits Safety Nets Exception Handling
• Data Services
• Business
services
• Aggregators
• Event handlers
• Listeners
• Transaction
tracking
• AOP –
Standard
elements
• Timeouts
• Circuit breakers
• Asynchronous
• Retry
• Appropriate HTTP
codes
• Functional errors
in response
Parthiban J
https://www.linkedin.com/in/parthibanj-ea/

More Related Content

PPTX
Modeling microservices using DDD
Masashi Narumoto
 
PPTX
Designing microservices part2
Masashi Narumoto
 
PPTX
Azure Application Architecture Guide
Masashi Narumoto
 
PDF
REST vs. Messaging For Microservices
Eberhard Wolff
 
PDF
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Maciej Swiderski
 
PDF
NATS: A Cloud Native Messaging System
Shiju Varghese
 
PDF
Building Applications with Carbon Studio on Premise and Cloud
WSO2
 
PDF
Application development using the wso2 developer studio
WSO2
 
Modeling microservices using DDD
Masashi Narumoto
 
Designing microservices part2
Masashi Narumoto
 
Azure Application Architecture Guide
Masashi Narumoto
 
REST vs. Messaging For Microservices
Eberhard Wolff
 
Deep Dive on Case Management in RedHat JBoss BPM Suite 7 - RedHat Summit 2017
Maciej Swiderski
 
NATS: A Cloud Native Messaging System
Shiju Varghese
 
Building Applications with Carbon Studio on Premise and Cloud
WSO2
 
Application development using the wso2 developer studio
WSO2
 

What's hot (20)

PPTX
WSO2Con 2011: Introduction to Stratos
Afkham Azeez
 
PDF
Microservices architecture
Mohammad Dameer
 
KEY
Event Driven Architecture at NDDNUG
Chris Patterson
 
PPTX
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2
 
PDF
WSO2 and 2 Degrees Case Study
WSO2
 
PDF
[WSO2Con EU 2017] Microservice Architecture (MSA) and Integration Microservices
WSO2
 
PDF
Modernizing the monolithic architecture to container based architecture apaco...
Vinay Kumar
 
PDF
Microservices in Go with Go kit
Shiju Varghese
 
PPTX
Do microservices dream about CQRS-ES, Kafka Stream and BPMN ? - Voxxed micros...
Cedric Vidal
 
PDF
[WSO2Con EU 2017] Container-native Architecture
WSO2
 
PDF
Empowering Development Governance with WSO2 Products
WSO2
 
PDF
Introduction to Configurable Governance Artifacts
WSO2
 
PPT
Enterprise Soa Concept
Terry Cho
 
PDF
Building Blocks of Enterprise Integration
WSO2
 
PPS
Oracle apps architecture
Vineet Kumar
 
PDF
Managing ESB artifacts with the WSO2 Governance Registry
WSO2
 
PDF
Tutorial Webservices
Fabian Lopez
 
PDF
SOA Pattern Event Driven Messaging
WSO2
 
PDF
Addressing Security Concerns with WSO2 Governance Registry Policy Store
WSO2
 
PDF
[WSO2Con EU 2017] Microservices for Enterprises
WSO2
 
WSO2Con 2011: Introduction to Stratos
Afkham Azeez
 
Microservices architecture
Mohammad Dameer
 
Event Driven Architecture at NDDNUG
Chris Patterson
 
WSO2Con2011: Delivering the Goods? Integrated Order Management & Billing with...
WSO2
 
WSO2 and 2 Degrees Case Study
WSO2
 
[WSO2Con EU 2017] Microservice Architecture (MSA) and Integration Microservices
WSO2
 
Modernizing the monolithic architecture to container based architecture apaco...
Vinay Kumar
 
Microservices in Go with Go kit
Shiju Varghese
 
Do microservices dream about CQRS-ES, Kafka Stream and BPMN ? - Voxxed micros...
Cedric Vidal
 
[WSO2Con EU 2017] Container-native Architecture
WSO2
 
Empowering Development Governance with WSO2 Products
WSO2
 
Introduction to Configurable Governance Artifacts
WSO2
 
Enterprise Soa Concept
Terry Cho
 
Building Blocks of Enterprise Integration
WSO2
 
Oracle apps architecture
Vineet Kumar
 
Managing ESB artifacts with the WSO2 Governance Registry
WSO2
 
Tutorial Webservices
Fabian Lopez
 
SOA Pattern Event Driven Messaging
WSO2
 
Addressing Security Concerns with WSO2 Governance Registry Policy Store
WSO2
 
[WSO2Con EU 2017] Microservices for Enterprises
WSO2
 
Ad

Similar to Micro services (20)

PPTX
Microservices Architecture
Alessandro Giorgetti
 
PDF
Microservices - Hitchhiker's guide to cloud native applications
Stijn Van Den Enden
 
PPTX
Microservices
Shamil Nunhuck
 
PDF
#ATAGTR2020 Presentation - Microservices – Explored
Agile Testing Alliance
 
PDF
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
PDF
Microservices for Architects - Atlanta 2018-03-28
Derek Ashmore
 
PDF
Microservices for java architects it-symposium-2015-09-15
Derek Ashmore
 
PPTX
Introduction to Microservices
MahmoudZidan41
 
PDF
Greach 2018: Surviving Microservices
Steve Pember
 
PPTX
Service Architectures at Scale
Randy Shoup
 
PDF
Migrating from a monolith to microservices – is it worth it?
Katherine Golovinova
 
PDF
Microservices: Where do they fit within a rapidly evolving integration archit...
Kim Clark
 
PDF
Microservices for Java Architects (Chicago, April 21, 2015)
Derek Ashmore
 
PPTX
Let's talk about... Microservices
Alessandro Giorgetti
 
PPTX
Iot cloud service v2.0
Vinod Wilson
 
PDF
Building microservices on azure
Vaibhav Gujral
 
PDF
Microservices_vs_SOA
Yakov Liskoff
 
PDF
Surviving in a microservices environment
Steve Pember
 
PDF
Modern software architectures - PHP UK Conference 2015
Ricard Clau
 
PDF
Microservices for java architects schamburg-2015-05-19
Derek Ashmore
 
Microservices Architecture
Alessandro Giorgetti
 
Microservices - Hitchhiker's guide to cloud native applications
Stijn Van Den Enden
 
Microservices
Shamil Nunhuck
 
#ATAGTR2020 Presentation - Microservices – Explored
Agile Testing Alliance
 
Microservices - opportunities, dilemmas and problems
Łukasz Sowa
 
Microservices for Architects - Atlanta 2018-03-28
Derek Ashmore
 
Microservices for java architects it-symposium-2015-09-15
Derek Ashmore
 
Introduction to Microservices
MahmoudZidan41
 
Greach 2018: Surviving Microservices
Steve Pember
 
Service Architectures at Scale
Randy Shoup
 
Migrating from a monolith to microservices – is it worth it?
Katherine Golovinova
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Kim Clark
 
Microservices for Java Architects (Chicago, April 21, 2015)
Derek Ashmore
 
Let's talk about... Microservices
Alessandro Giorgetti
 
Iot cloud service v2.0
Vinod Wilson
 
Building microservices on azure
Vaibhav Gujral
 
Microservices_vs_SOA
Yakov Liskoff
 
Surviving in a microservices environment
Steve Pember
 
Modern software architectures - PHP UK Conference 2015
Ricard Clau
 
Microservices for java architects schamburg-2015-05-19
Derek Ashmore
 
Ad

Recently uploaded (20)

PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
DOCX
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PDF
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PDF
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PPTX
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Can You Build Dashboards Using Open Source Visualization Tool.docx
Varsha Nayak
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
vAdobe Premiere Pro 2025 (v25.2.3.004) Crack Pre-Activated Latest
imang66g
 
Presentation about variables and constant.pptx
kr2589474
 
oapresentation.pptx
mehatdhavalrajubhai
 
Exploring AI Agents in Process Industries
amoreira6
 
ASSIGNMENT_1[1][1][1][1][1] (1) variables.pptx
kr2589474
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
Enhancing Healthcare RPM Platforms with Contextual AI Integration
Cadabra Studio
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
Web Testing.pptx528278vshbuqffqhhqiwnwuq
studylike474
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 

Micro services

  • 1. Microservices Practicalities and Things to watch out for Parthiban J https://www.linkedin.com/in/parthibanj-ea/
  • 2. What is Micro services ? Framework ? Deployment model ? Architectural Pattern ? Obviously , Microservices is not a silver bullet and is not the only way to architect applications
  • 3. The Difference • Tightly coupled • Scaling is an issue • Functionality as services • Must fit into overall design • Rules and protocols govern communication • Loosely coupled • Bounded context • Scalable • What you expose to consumers • Could be a single service or a collection Monolith SOA Microservices API
  • 4. Why Microservices • Deploy individually without impacting other services • Independent deployment = Quicker time to market • Selective scaling • Fault Isolation
  • 5. The Ecosystem Composition DB Architecture Service Definition Service Registry Service Discovery Deployment Security Composition – Decompose by business capability, by sub domain DB Architecture – Dedicate DB per service, Shared DB Service Definition – Contract definition Service Registry – Self Registry, Third Party Service Discovery – Client side, Server side Deployment – VM, Containers, Serverless Security – API Gateway, Tokens
  • 6. The First step – Identifying your services Domain driven design (DDD) Entity outside domain Inventory Order Product Customer Order History Price …… ……. Your Domain Define & use integration channels for external communications Sub Domain • Domain = Your problem space , your scope • DDD -> Break your complex problem into sub domains • Identify : Entities, interactions and their boundaries • Bounded context • Define rules of interactions and place the ownership of management appropriately Tips - Building a service catalogue • Focus on single responsibility - service must do one thing and only one thing • Fine Vs Coarse grain -> Transaction block sizes must be manageable
  • 7. Dedicated Vs Shared DB • Segregated ownership • Cross references Vs Data Redundancy Vs Scalability considerations • Data Sync – Changelogs, events , pull Ordering DB Ordering Customers Sales Customer DB Sales DB Dedicated DB ( Preferred ) Shared DB Ordering Customers Sales Shared DB (Trade Off ) • Will work, but must be cautious about responsibility segregation • Multiple schemas within a same DB is an option • Always keep selective scaling and change management in mind
  • 8. Transaction Management CAP Theorem – You can have just 2 and not all 3 Eventual Consistency • Will have to move from strict to eventual consistency • Can be implemented in 2 ways : • 2 Phased commit • Prepare phase • Commit phase • SAGA pattern • Choreography • Orchestration Consistency Querying • CRUD vs CQRS • Traditional CRUD – Create, Read, Update, Delete model • CQRS - Command Query Responsibility Segregation • 2 Different models for Write and Read • Command – Create / Update transactions • Query – Read
  • 9. Service Definition Reasons why you must have a contract • Let the world know what the service is about • Document your service contract – Input & output • Use : RAML, Swagger or any tool • Some tools let you generate code from contract definitions.. Yay ! • You can even write test automation scripts from contract Hey world am here This is how you reach me
  • 10. Service Registry Self Registry Third Party Service Registry Service Registry RegistrarHeartbeat (De)Register Heartbeat Register • Service instances are responsible for registering and deregistering • Pro : Does not need other components to manage registrations • Con : Every service / framework used must implement a registering mechanism • “Registrar” component manages service registration. Many deployment environments have service registration inbuilt • Pro : Do not have to implement the registration per implementation language and framework • Con : Registrar is one more component to manage and assure availability
  • 11. Service Discovery • Client queries registry and is responsible for load balancing • E.g Ribbon – load balancer • Client just calls a DNS URL. • E.g AWS elastic load balancer (ELB) Client Side Server Side Service Registry Service Service Service Client Service Registry Service Service Service Client Load Balancer
  • 12. Deployment models Deploy them on a traditional VM as multiple instances Deploy them on a dedicated VMs Of course, You can deploy them as containers Serverless, Yay !! Why not
  • 13. Security – Gateways and Tokens API Gateway Security Routing API mgmt. Audit …… S1 S3 S2 S4 Client 1 Client 2 Client 3 API Gateway Vs Service registry – Most API gateways have inbuilt integration to registries API Gateway Vs Service mesh – Mesh is a network communication infrastructure. Circuit breaker, fault injection, health check Client 1 Client 2 Client 3 Design Goal : Stateless Knowing State: Stick sessions, session replication Tokens : JWT, OAuth
  • 14. Other things to consider Service Segregation Audits Safety Nets Exception Handling • Data Services • Business services • Aggregators • Event handlers • Listeners • Transaction tracking • AOP – Standard elements • Timeouts • Circuit breakers • Asynchronous • Retry • Appropriate HTTP codes • Functional errors in response