SlideShare a Scribd company logo
1 of 35
Download to read offline
Service Discovery
or
Why each microservice should believe it's
the only one in the world.
Richard Rodger
@rjrodger
What are microservices?
๏ Small independent processes;
๏ Communicating via messages;
๏ A powerful component model.
Why use microservices?
๏ Avoid technical debt;
๏ Get continuous delivery;
๏ Build fast.
What are the trade-offs?
๏ Deployment is more complex;
๏ Weird programming model;
๏ Services have to find each other;
Configuration Files
๏ Hard code all the locations;
๏ Automate update and reloads;
๏ Surprisingly workable;
๏ But gets messy fast!
Intelligent Load Balancing
๏ The load balancer knows where services are;
๏ Services have to register in some way;
๏ Load balancers are yet more things to manage;
๏ URL paths are still identifiers!
๏ Examples: Netflix Eureka, nginx, HAProxy
Service Registries
๏ Services lookup locations;
๏ Registries can provide health checks;
๏ Registries themselves need to be distributed;
๏ Service A still knows about Service B!
๏ Examples: consul, etcd, zookeeper
DNS
๏ Hide services behind domain names;
๏ We know DNS can scale;
๏ More management work;
๏ Service A still knows about Service B!
๏ Examples: Mesos, Weave, SkyDNS
Message Bus
๏ Hide services behind topic names;
๏ Nice for publish/subscribe models!
๏ You have to manage the bus;
๏ Rapids, rivers and pools;
๏ Topics are weak identifiers - better!
๏ Examples: Kafka, Rabbitmq, Redis
Pattern Matching
	 Service discovery is an anti-pattern.
	 Instead, make messages first-class citizens.
	 Use message data to define patterns,
	 	 and these patterns define a language!
	
Transport Independence
	 Services should not know about each other,
	 	 or how to send messages.
	 Services are fully defined by:
	 	 message patterns that they recognise, and
	 	 message patterns that they emit.
Blind Messages
๏ Services have zero-knowledge of other services;
๏ Services emit messages into the world;
๏ Services let the world know what they care about;
๏ The underlying infrastructure handles identity;
๏ Works with any of the service discovery methods!
Peer-to-peer
๏ Knowledge of identity can be distributed;
๏ Each service maintains a local view of world,
and updates this view as services come and go;
๏ Mapping from message to destination is not
exposed to developers.
SWIM
๏ "Scalable Weakly-consistent Infection-style
Process Group Membership Protocol"
๏ https://www.cs.cornell.edu/~asdas/research/dsn02-swim.pdf
๏ Designed for large scale (used by Uber);
๏ Basic idea:
๏ each service pings a random subset of other
services, different each time
๏ the pings establish health and disseminate
membership information
// a search message
{
"role": "search", // a namespace
"cmd": "search", // this is a command
"query": "ldap", // some data
}
!
// the pattern to match
role:search,cmd:search
// some nodezoo message patterns
!
role:search,cmd:search // do a search
role:search,cmd:insert // insert into index
role:info,cmd:get // get module info
role:npm,cmd:get // get npm data
role:npm,info:change // module changed!
role:info,req:part // need module info
role:info,res:part // here's module info
!
!
!
role:search,cmd:search
role:info,cmd:get
synchronous request/response
role:npm,info:change
asynchronous "winner-take-all"
(actor)
role:info,req:part
asynchronous "fire-and-forget"
(publish/subscribe)
role:info,res:part
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
synchronous/
asynchronous
consumed/
observed
// nodezoo-web
IN:
none
OUT:
role:search,cmd:search // sync
role:info,cmd:get // sync
// nodezoo-search
IN:
role:search,cmd:search // sync
role:search,cmd:insert // async
OUT:
none
service specification
// nodezoo-info
IN:
role:info,cmd:get // sync
role:info,res:part // async
OUT:
role:info,req:part // async
// nodezoo-npm
IN:
role:npm,cmd:get // sync
role:npm,info:change // async
role:info,req:part // async
OUT:
role:info,res:part // async
service specification
// role:search,cmd:search
consumed:
nodezoo-web -> nodezoo-search
// role:info,cmd:get
consumed:
nodezoo-web -> nodezoo-info
// role:npm,info:change
observed:
nodezoo-update -> nodezoo-npm
service interactions
// role:info,req:part
observed:
nodezoo-info -> nodezoo-npm
nodezoo-info -> nodezoo-github
// role:info,res:part
observed:
nodezoo-npm -> nodezoo-info
nodezoo-github -> nodezoo-info
service interactions
senecajs.org
Code!
github.com/rjrodger/nodezoo
Thanks!
Richard Rodger
@rjrodger
richardrodger.com
senecajs.org
github.com/apparatus/fuge

More Related Content

Viewers also liked

Viewers also liked (19)

Traditional Vs. Social Media Prospecting
Traditional Vs. Social Media ProspectingTraditional Vs. Social Media Prospecting
Traditional Vs. Social Media Prospecting
 
Waste Segregation for Dummies - New
Waste Segregation for Dummies - NewWaste Segregation for Dummies - New
Waste Segregation for Dummies - New
 
Game of thrones longform tv
Game of thrones longform tv Game of thrones longform tv
Game of thrones longform tv
 
Redes Sociais
Redes SociaisRedes Sociais
Redes Sociais
 
Zaragoza turismo 203
Zaragoza turismo 203Zaragoza turismo 203
Zaragoza turismo 203
 
What Is Content Strategy? (ACS July Meetup)
What Is Content Strategy? (ACS July Meetup)What Is Content Strategy? (ACS July Meetup)
What Is Content Strategy? (ACS July Meetup)
 
World's Most Spectacular Tennis Courts
World's Most Spectacular Tennis CourtsWorld's Most Spectacular Tennis Courts
World's Most Spectacular Tennis Courts
 
Ramsey Theory
Ramsey TheoryRamsey Theory
Ramsey Theory
 
December Political Monitor: Attitudes to coalitions_191214
December Political Monitor: Attitudes to coalitions_191214December Political Monitor: Attitudes to coalitions_191214
December Political Monitor: Attitudes to coalitions_191214
 
Puppet Camp Portland 2014: Masterless Puppet in AWS
Puppet Camp Portland 2014: Masterless Puppet in AWSPuppet Camp Portland 2014: Masterless Puppet in AWS
Puppet Camp Portland 2014: Masterless Puppet in AWS
 
Leveraging Social Media for Trade Shows Webinar Slides from The Trade Group W...
Leveraging Social Media for Trade Shows Webinar Slides from The Trade Group W...Leveraging Social Media for Trade Shows Webinar Slides from The Trade Group W...
Leveraging Social Media for Trade Shows Webinar Slides from The Trade Group W...
 
Collaborative Exploratory and Unit testing -talk at Testival
Collaborative Exploratory and Unit testing -talk at TestivalCollaborative Exploratory and Unit testing -talk at Testival
Collaborative Exploratory and Unit testing -talk at Testival
 
Oferta grupului Romelectro - Industrie
Oferta grupului Romelectro - IndustrieOferta grupului Romelectro - Industrie
Oferta grupului Romelectro - Industrie
 
Cómo reducir el peso de una imagen a partir de las dimensiones. Con Microsoft...
Cómo reducir el peso de una imagen a partir de las dimensiones. Con Microsoft...Cómo reducir el peso de una imagen a partir de las dimensiones. Con Microsoft...
Cómo reducir el peso de una imagen a partir de las dimensiones. Con Microsoft...
 
Learning Analytics & Exploratory Dialogue
Learning Analytics & Exploratory DialogueLearning Analytics & Exploratory Dialogue
Learning Analytics & Exploratory Dialogue
 
Academic Library Reference Collection
Academic Library Reference CollectionAcademic Library Reference Collection
Academic Library Reference Collection
 
Fiche de participation Etranjailleurs 2013-2014
Fiche de participation Etranjailleurs 2013-2014Fiche de participation Etranjailleurs 2013-2014
Fiche de participation Etranjailleurs 2013-2014
 
15NTC: What to Do When Technology Isn't Your Problem?
15NTC: What to Do When Technology Isn't Your Problem?15NTC: What to Do When Technology Isn't Your Problem?
15NTC: What to Do When Technology Isn't Your Problem?
 
私のアーキテクチャルディシジョン
私のアーキテクチャルディシジョン私のアーキテクチャルディシジョン
私のアーキテクチャルディシジョン
 

Similar to Service Discovery or Why each micro service should believe it's the only one in the world

richardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdfrichardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdf
Richard Rodger
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 

Similar to Service Discovery or Why each micro service should believe it's the only one in the world (20)

richardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdfrichardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdf
 
Grokking microservices in 5 minutes
Grokking microservices in 5 minutesGrokking microservices in 5 minutes
Grokking microservices in 5 minutes
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. JuričJavantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
Javantura v4 - Cloud-native Architectures and Java - Matjaž B. Jurič
 
Serverless: The future of application delivery
Serverless: The future of application deliveryServerless: The future of application delivery
Serverless: The future of application delivery
 
Microservices with Spring
Microservices with SpringMicroservices with Spring
Microservices with Spring
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
A Gentle introduction to microservices
A Gentle introduction to microservicesA Gentle introduction to microservices
A Gentle introduction to microservices
 
What serverless means for enterprise apps
What serverless means for enterprise appsWhat serverless means for enterprise apps
What serverless means for enterprise apps
 
The Case Against Microservices
The Case Against MicroservicesThe Case Against Microservices
The Case Against Microservices
 
Introduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregationIntroduction to CQRS - command and query responsibility segregation
Introduction to CQRS - command and query responsibility segregation
 
Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...Kong Summit 2018 - Microservices: decomposing applications for testability an...
Kong Summit 2018 - Microservices: decomposing applications for testability an...
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
The 7 deadly sins of micro services
The 7 deadly sins of micro servicesThe 7 deadly sins of micro services
The 7 deadly sins of micro services
 
Microservices: Yes or not?
Microservices: Yes or not?Microservices: Yes or not?
Microservices: Yes or not?
 
Microservices in Practice
Microservices in PracticeMicroservices in Practice
Microservices in Practice
 
Microservices Without the Hassle
Microservices Without the HassleMicroservices Without the Hassle
Microservices Without the Hassle
 
Microservices Without The Hassle
Microservices Without The HassleMicroservices Without The Hassle
Microservices Without The Hassle
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
 
Monoliths, Myths, and Microservices - CfgMgmtCamp
Monoliths, Myths, and Microservices - CfgMgmtCampMonoliths, Myths, and Microservices - CfgMgmtCamp
Monoliths, Myths, and Microservices - CfgMgmtCamp
 

More from icemobile

More from icemobile (20)

Design thinking for play meetup
Design thinking for play meetup Design thinking for play meetup
Design thinking for play meetup
 
Context chat UXcamp Amsterdam 2017
Context chat UXcamp Amsterdam 2017Context chat UXcamp Amsterdam 2017
Context chat UXcamp Amsterdam 2017
 
Analysing Memory Leaks
Analysing Memory LeaksAnalysing Memory Leaks
Analysing Memory Leaks
 
A date with data - CI’s Great British data visualisation adventure
A date with data - CI’s Great British data visualisation adventureA date with data - CI’s Great British data visualisation adventure
A date with data - CI’s Great British data visualisation adventure
 
Context Chat - why, what & how
Context Chat - why, what & howContext Chat - why, what & how
Context Chat - why, what & how
 
TAPOST Conference 2016 Riga // Better Products Faster: Let's bring the user i...
TAPOST Conference 2016 Riga // Better Products Faster: Let's bring the user i...TAPOST Conference 2016 Riga // Better Products Faster: Let's bring the user i...
TAPOST Conference 2016 Riga // Better Products Faster: Let's bring the user i...
 
Retail Loyalty Congress 2016 Masterclass IceMobile // Toronto Canada
Retail Loyalty Congress 2016 Masterclass IceMobile // Toronto CanadaRetail Loyalty Congress 2016 Masterclass IceMobile // Toronto Canada
Retail Loyalty Congress 2016 Masterclass IceMobile // Toronto Canada
 
Ladies that UX Amsterdam 18082016 - Experience Mapping with IceMobile
Ladies that UX Amsterdam 18082016 - Experience Mapping with IceMobile Ladies that UX Amsterdam 18082016 - Experience Mapping with IceMobile
Ladies that UX Amsterdam 18082016 - Experience Mapping with IceMobile
 
Explorations in Cooperative Distributed Systems with Uber's Ringpop
Explorations in Cooperative Distributed Systems with Uber's RingpopExplorations in Cooperative Distributed Systems with Uber's Ringpop
Explorations in Cooperative Distributed Systems with Uber's Ringpop
 
About- Face: Reflections on Growing an Open-Source Mentality
About- Face: Reflections on Growing an Open-Source MentalityAbout- Face: Reflections on Growing an Open-Source Mentality
About- Face: Reflections on Growing an Open-Source Mentality
 
An Amsterdam perspective on Design Thinking
An Amsterdam perspective on Design ThinkingAn Amsterdam perspective on Design Thinking
An Amsterdam perspective on Design Thinking
 
Profiling tools and Android Performance patterns
Profiling tools and Android Performance patternsProfiling tools and Android Performance patterns
Profiling tools and Android Performance patterns
 
Mobile App Europe 2015 Pulse UX Workshop Presentation
Mobile App Europe 2015 Pulse UX Workshop PresentationMobile App Europe 2015 Pulse UX Workshop Presentation
Mobile App Europe 2015 Pulse UX Workshop Presentation
 
Product Tank Amsterdam Pulse UX Presentation
Product Tank Amsterdam Pulse UX PresentationProduct Tank Amsterdam Pulse UX Presentation
Product Tank Amsterdam Pulse UX Presentation
 
AMS Node Meetup February presentation Jasper Spoel
AMS Node Meetup February presentation Jasper SpoelAMS Node Meetup February presentation Jasper Spoel
AMS Node Meetup February presentation Jasper Spoel
 
AMS Node Meetup, Node Summit 2015 Recap
AMS Node Meetup, Node Summit 2015 RecapAMS Node Meetup, Node Summit 2015 Recap
AMS Node Meetup, Node Summit 2015 Recap
 
AMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion PassengerAMS Node Meetup December presentation Phusion Passenger
AMS Node Meetup December presentation Phusion Passenger
 
Design Thinking to accelerate Innovation - Masterclass on RLC2015 Barcelona
Design Thinking to accelerate Innovation - Masterclass on RLC2015 BarcelonaDesign Thinking to accelerate Innovation - Masterclass on RLC2015 Barcelona
Design Thinking to accelerate Innovation - Masterclass on RLC2015 Barcelona
 
The Numbers Magic (Amsterdam Node Meetup Presentation)
The Numbers Magic (Amsterdam Node Meetup Presentation)The Numbers Magic (Amsterdam Node Meetup Presentation)
The Numbers Magic (Amsterdam Node Meetup Presentation)
 
ProductTank Amsterdam - IceMobile Karlijn van den Berg
ProductTank Amsterdam - IceMobile Karlijn van den BergProductTank Amsterdam - IceMobile Karlijn van den Berg
ProductTank Amsterdam - IceMobile Karlijn van den Berg
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Service Discovery or Why each micro service should believe it's the only one in the world