SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
How Microservices Fail…
and what to do about it.
Richard Rodger
@rjrodger
github.com/rjrodger/nodezoo
https://aws.amazon.com/message/5467D2/
github.com/rjrodger/nodezoo
github.com/rjrodger/nodezoo
github.com/rjrodger/nodezoo
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.
github.com/rjrodger/nodezoo
// 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
github.com/rjrodger/nodezoo
// 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
!
!
!
github.com/rjrodger/nodezoo
role:search,cmd:search
role:info,cmd:get
synchronous request/response
github.com/rjrodger/nodezoo
role:npm,info:change
asynchronous "winner-take-all"
(actor)
github.com/rjrodger/nodezoo
role:info,req:part
asynchronous "fire-and-forget"
(publish/subscribe)
role:info,res:part
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
synchronous/
asynchronous
consumed/
observed
github.com/rjrodger/nodezoo
senecajs.org
github.com/rjrodger/nodezoo
code
(branch: msdub201509)
github.com/rjrodger/nodezoo
kintsugi ⾦金継ぎ
(golden joinery)
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
How do these break?
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
github.com/rjrodger/nodezoo
failure mode
"Slow downstream"
B responses are getting slower,
consuming As resources.
mitigation
Drop B.
A should consider B dead.
Or: the transport should handle this.
github.com/rjrodger/nodezoo
failure mode
"Upstream overload"
A is sending messages to B
at a higher rate than B can handle.
mitigation
Back-pressure from B.
A should accept back pressure
notifications and scale back.
Assumes B is doing more work than A.
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
github.com/rjrodger/nodezoo
failure mode
"Lost Actions"
A is sending messages to B,
and C is listening. But perhaps the
latest version of C is broken?
mitigation
Measure message flow rates.
Do the flow ratios match
the business rules?
github.com/rjrodger/nodezoo
failure mode
"Broken Contracts"
A and B are using a newer
message schema,
but you forgot about C.
mitigation
Don't use contracts!
Message schemas are a
net negative and hinder
multi-version deployment.
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
github.com/rjrodger/nodezoo
failure mode
"Poison Message"
A is sending messages that crash B.
B keeps restarting and trying to handle
the poison message. Now nothing works!
mitigation
B should drop out of date messages
on the floor. B should maintain a list of
recently seen messages and ignore duplicates.
B sends bad messages to the "Dead Letter" log.
github.com/rjrodger/nodezoo
failure mode
"Guaranteed Delivery ... ain't"
B expects at-most-once, exactly-one,
or at-least-once delivery of
unique messages. This is not possible.
mitigation
Idempotency.
Where possible, duplicate messages
should have no bad effects.
github.com/rjrodger/nodezoo
asynchronous "fire-and-forget"
(publish/subscribe)
synchronous request/response
asynchronous "winner-take-all"
(actor)
synchronous "sidewinder"
(side effects!)
github.com/rjrodger/nodezoo
failure mode
"Emergent Behaviour"
Strange loops and unexplained
message paths make it hard to understand
what the system is doing.
mitigation
Correlate messages.
Attach correlation identifiers to messages
so that you can trace the flow of causality.
github.com/rjrodger/nodezoo
failure mode
"Catastrophic Collapse"
You've introduced feedback
that grows exponentially.
And you've no idea how to fix it.
mitigation
Have a kill switch.
Microservices aren't a
silver bullet. Sometimes you
need to selectively reboot.
github.com/rjrodger/nodezoo
P( success ) = 1
P( failure ) < ε
vs.
github.com/rjrodger/nodezoo
// apoptosis
setTimeout(function(){
process.exit(0)
}, 60*60*1000*Math.random())
!
!
!
!
!
!
!
!
!
Thanks!
Richard Rodger
@rjrodger

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (7)

Rapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js DeliversRapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js Delivers
 
Microservices With SenecaJS
Microservices With SenecaJSMicroservices With SenecaJS
Microservices With SenecaJS
 
Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)Microservices with SenecaJS (part 2)
Microservices with SenecaJS (part 2)
 
VisibleThread 2016 Users Conference - Company Overview
VisibleThread 2016 Users Conference - Company OverviewVisibleThread 2016 Users Conference - Company Overview
VisibleThread 2016 Users Conference - Company Overview
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
 
Richard rodger technical debt - web summit 2013
Richard rodger   technical debt - web summit 2013Richard rodger   technical debt - web summit 2013
Richard rodger technical debt - web summit 2013
 
Chasing elephants
Chasing elephantsChasing elephants
Chasing elephants
 

Ähnlich wie How microservices fail, and what to do about it

SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
Jesse Vincent
 
Construction Techniques For Domain Specific Languages
Construction Techniques For Domain Specific LanguagesConstruction Techniques For Domain Specific Languages
Construction Techniques For Domain Specific Languages
ThoughtWorks
 
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
ferreroroche11
 

Ähnlich wie How microservices fail, and what to do about it (20)

SD, a P2P bug tracking system
SD, a P2P bug tracking systemSD, a P2P bug tracking system
SD, a P2P bug tracking system
 
The Mysteries Of JavaScript-Fu (@media SF Edition)
The Mysteries Of JavaScript-Fu (@media SF Edition)The Mysteries Of JavaScript-Fu (@media SF Edition)
The Mysteries Of JavaScript-Fu (@media SF Edition)
 
SxSW 2015
SxSW 2015SxSW 2015
SxSW 2015
 
Trusting files (and their formats)
Trusting files (and their formats)Trusting files (and their formats)
Trusting files (and their formats)
 
Massive applications in node.js
Massive applications in node.jsMassive applications in node.js
Massive applications in node.js
 
Tips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software EngineeringTips And Tricks For Bioinformatics Software Engineering
Tips And Tricks For Bioinformatics Software Engineering
 
Writing Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScriptWriting Bullet-Proof Javascript: By Using CoffeeScript
Writing Bullet-Proof Javascript: By Using CoffeeScript
 
Construction Techniques For Domain Specific Languages
Construction Techniques For Domain Specific LanguagesConstruction Techniques For Domain Specific Languages
Construction Techniques For Domain Specific Languages
 
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
When Will Drupal Die? Keynote talk from Bay Area Drupal Camp 2014
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Rails Development That Doesn't Hurt
Rails Development That Doesn't HurtRails Development That Doesn't Hurt
Rails Development That Doesn't Hurt
 
Go language presentation
Go language presentationGo language presentation
Go language presentation
 
BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
 
Flow
FlowFlow
Flow
 
The D language comes to help
The D language comes to helpThe D language comes to help
The D language comes to help
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Talking to strangers causes train wrecks
Talking to strangers causes train wrecksTalking to strangers causes train wrecks
Talking to strangers causes train wrecks
 
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
89025069 mike-krieger-instagram-at-the-airbnb-tech-talk-on-scaling-instagram
 
Scaling Instagram
Scaling InstagramScaling Instagram
Scaling Instagram
 
Ruby codebases in an entropic universe
Ruby codebases in an entropic universeRuby codebases in an entropic universe
Ruby codebases in an entropic universe
 

Mehr von Richard Rodger

Using RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdfUsing RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdf
Richard Rodger
 
Richard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdfRichard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdf
Richard Rodger
 
richard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdfrichard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdf
Richard Rodger
 
richardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdfrichardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdf
Richard Rodger
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
Richard Rodger
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
Richard Rodger
 
richardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdfrichardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdf
Richard Rodger
 
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
 
How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)
Richard Rodger
 
Richard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbonRichard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbon
Richard Rodger
 

Mehr von Richard Rodger (20)

Using RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdfUsing RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdf
 
Richard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdfRichard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdf
 
richard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdfrichard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdf
 
richardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdfrichardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdf
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
 
richardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdfrichardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdf
 
richardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdfrichardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdf
 
richardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdfrichardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdf
 
Richardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-octRichardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-oct
 
Richardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-finalRichardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-final
 
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-finalRichardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle Scars
 
The Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 ConferenceThe Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 Conference
 
How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)
 
Richard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbonRichard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbon
 
20120802 timisoara
20120802 timisoara20120802 timisoara
20120802 timisoara
 
20120816 nodejsdublin
20120816 nodejsdublin20120816 nodejsdublin
20120816 nodejsdublin
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 
20120514 nodejsdublin
20120514 nodejsdublin20120514 nodejsdublin
20120514 nodejsdublin
 

Kürzlich hochgeladen

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Kürzlich hochgeladen (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 

How microservices fail, and what to do about it