SlideShare a Scribd company logo
1 of 25
Download to read offline
Microservices & resilience
Maxim Shelest
Architect at PAYBACK GmbH
#architect #developer #programmer #software-
craftsman #life-long-learner #leader #agile-
practitioner
Lormem ipsum
Microservices & resilience 2
https://source.superherostuff.com/wp-content/uploads/2015/09/IEVaULq.png
• Microservice(s) is in production or will be in production soon
• Clear separated business capabilities between microservices using DD principles
• Automated continuous deployment pipeline
• DEVOPS culture
• Monitoring and alerting with detailed dashboards
About to launch a project
Microservices & resilience 3
Does “feature complete” mean
“production ready”?
?
Microservices & resilience 4
Anything that can go wrong will go
wrong.
Murphy's law
Microservices & resilience 5
Resilience
"Resilient systems provide and maintain an acceptable level
of service in face of faults (unintentional, intentional, or naturally caused)
affecting their normal operation"
Microservices & resilience 6
Lorem ipsum dolor sit
7
Do not forget resilience during estimations.
Where resilience begins?
Microservices & resilience 8
It is not only about
Microservices!
• recovery
• retry: very basic recovery mechanism
• self-healing: reinitialize components, either internally or by an external monitoring system (automatic service
restart, start service upon machine boot)
• retry budget: if the retry budget is exceeded, don’t retry; just fail the request to omit overloading (see circuit
breaker)
• exponential backoff with jitter: use randomized exponential backoff when scheduling retries
• bulkheads: partition your systems, so that you can keep a failure in one part of the system from destroying
everything
• complete parameter checking: protection from broken / malicious calls (Postel’s law: be liberal in what you
accept, and conservative in what you send)
• asynchronous communication (sender does not need to wait for receiver's response)
• event driven (event notification, event-carried state transfer, event-sourcing, CQRS)
• location transparency: sender does not need to know receiver’s concrete location
• zero downtime deployment: deployment is a bad reason for user facing unavailability
• stateless (service failover is hard with state)
Resiliency patterns (1)
Microservices & resilience 9
• relaxed temporal constraints: use a more relaxed consistency model to reduce coupling. The real world is not
ACID, it is BASE.
• idempotence
• self contained deployment: services are self-contained deployment units (compatibility between dependent
components/APIs)
• timeouts
• circuit breakers: prevent a failure from constantly recurring
• failover
• fallback/graceful degradation: The ability of maintaining functionality when portions of a system break down
• error handler: separate business logic and error handling
• fail fast: add checks in front of expensive operations, avoid foreseeable failures, also called Handshaking)
• fan out & quickest reply: send request to multiple workers - use quickest reply and discard all other responses
• bounded queues: avoids latency due to overloaded resources (use thread pools and
connection pools)
Resiliency patterns (2)
Microservices & resilience 10
• shed load: shed requests based on resource load
• observability: goal is to automatically act on detected failures
• monitoring:
• health checks,
• synthetic transactions,
• monitor metrics
• alerting/visualization
• distributed systems tracing
• log aggregation/analytics
Resiliency patterns (3)
Microservices & resilience 11
Always think about
composition of patterns
to achieve resilience
Synchronous vs Asynchronous
Microservices & resilience 12
Do not use synchronous communication! Asynchronous is better!
The event-based or event-driven approach is a de facto worldwide standard for
implementation of asynchronous communication in microservices architectures.
Synchronous vs Asynchronous
Microservices & resilience 13
Do not use synchronous communication! Asynchronous is better!
The event-based or event-driven approach is a de facto worldwide standard for
implementation of asynchronous communication in microservices architectures.
Order
Service
Shipping
Service
shipNewOrder
produce
Order
message broker
consume
Order
"But we need to query data from
other Microservice?"
?
Microservices & resilience 14
Command Query Responsibility Segregation
Microservices & resilience 15
Order
Service
Customer
Service
produce
Order
message broker
Customer
View
Service
produce
Customer
Customers
Orders
findHighValueCustomers
Customers
Orders
16
"But we still need to connect to other
systems synchronously, for example
using HTTP(S)!"
Important resilience patterns implementing HTTP client
Microservices & resilience 17
Timeouts
Retry
Retry budget
Important resilience patterns implementing HTTP client
Microservices & resilience 18
Timeouts
Retry
Retry budget
Exponential
backoff
Circuit
breaker
Important resilience patterns implementing HTTP client
Microservices & resilience 19
Timeouts
Retry
Retry budget
Exponential
backoff
Circuit
breaker
Bulkheads
Shed load
Important resilience patterns implementing HTTP client
Microservices & resilience 20
Timeouts
Retry
Retry budget
Exponential
backoff
Circuit
breaker
Bulkheads
Shed load Fail fast
Fan out &
quickest reply
Caching
Important resilience patterns implementing HTTP client
Microservices & resilience 21
Timeouts
Retry
Retry budget
Exponential
backoff
Circuit
breaker
Bulkheads
Shed load Fail fast
Fan out &
quickest reply
Caching
Observability
Monitoring
Alerting
Tracing
Log aggregation
Build for production and not for test
environment.
22
Remember TANSTAAFL:
there ain’t no such thing as a free lunch.
Do not over engineer your
system!
"Debugging is twice as hard as
writing the code in the first place.
Therefore, if you write the code as
cleverly as possible, you are, by
definition, not smart enough to
debug it."
Brian W. Kernighan
Lormem ipsum
Microservices & resilience 23
Learn from production problems!
• “The cost of failure is education (Devin Carraway)”.
• Use blameless postmortems
(https://landing.google.com/sre/book/chapters/postmortem-culture.html)
• Human error is never a root cause!
• Resilience should be a 4th management objective,
alongside Better/Faster/Cheaper.
Microservices & resilience 24
Thank you!
Questions?

More Related Content

What's hot

Site (Service) Reliability Engineering
Site (Service) Reliability EngineeringSite (Service) Reliability Engineering
Site (Service) Reliability EngineeringMark Underwood
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment StrategiesAbdennour TM
 
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.
 
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...Tori Wieldt
 
How to Prepare for CKA Exam
How to Prepare for CKA ExamHow to Prepare for CKA Exam
How to Prepare for CKA ExamAlfie Chen
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architectureThe Software House
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes VMware Tanzu
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAraf Karsh Hamid
 
Microservices for Application Modernisation
Microservices for Application ModernisationMicroservices for Application Modernisation
Microservices for Application ModernisationAjay Kumar Uppal
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patternsMasashi Narumoto
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Kai Wähner
 

What's hot (20)

Site (Service) Reliability Engineering
Site (Service) Reliability EngineeringSite (Service) Reliability Engineering
Site (Service) Reliability Engineering
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment Strategies
 
SRE vs DevOps
SRE vs DevOpsSRE vs DevOps
SRE vs DevOps
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
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...
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google Scale
 
Azure dev ops
Azure dev opsAzure dev ops
Azure dev ops
 
Patterns of resilience
Patterns of resiliencePatterns of resilience
Patterns of resilience
 
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...
SRE-iously! Defining the Principles, Habits, and Practices of Site Reliabilit...
 
How to Prepare for CKA Exam
How to Prepare for CKA ExamHow to Prepare for CKA Exam
How to Prepare for CKA Exam
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
 
Microservices for Application Modernisation
Microservices for Application ModernisationMicroservices for Application Modernisation
Microservices for Application Modernisation
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patterns
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 

Similar to Resilient microservices

Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0Vinod Wilson
 
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...David Currie
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservicesAnil Allewar
 
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
 
Microservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedMicroservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedShailendra Chauhan
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Judy Breedlove
 
Redis and Kafka - Advanced Microservices Design Patterns Simplified
Redis and Kafka - Advanced Microservices Design Patterns SimplifiedRedis and Kafka - Advanced Microservices Design Patterns Simplified
Redis and Kafka - Advanced Microservices Design Patterns SimplifiedAllen Terleto
 
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...HostedbyConfluent
 
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...AFAS Software
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudMarkus Eisele
 
Best Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with MicroservicesBest Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with MicroservicesJim (张建军) Zhang
 
Regulated Reactive - Security Considerations for Building Reactive Systems in...
Regulated Reactive - Security Considerations for Building Reactive Systems in...Regulated Reactive - Security Considerations for Building Reactive Systems in...
Regulated Reactive - Security Considerations for Building Reactive Systems in...Ryan Hodgin
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsAraf Karsh Hamid
 
Application Darwinism - Why Most Enterprise Apps Will Evolve to the Cloud
Application Darwinism - Why Most Enterprise Apps Will Evolve to the CloudApplication Darwinism - Why Most Enterprise Apps Will Evolve to the Cloud
Application Darwinism - Why Most Enterprise Apps Will Evolve to the CloudSkytap Cloud
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSAlessandro Melchiori
 
Continuous delivery by sergey seletsky
Continuous delivery by sergey seletskyContinuous delivery by sergey seletsky
Continuous delivery by sergey seletskySergey Seletsky
 
IBM Managing Workload Scalability with MQ Clusters
IBM Managing Workload Scalability with MQ ClustersIBM Managing Workload Scalability with MQ Clusters
IBM Managing Workload Scalability with MQ ClustersIBM Systems UKI
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSAlessandro Melchiori
 

Similar to Resilient microservices (20)

Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
 
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
Microservice Builder: A Microservice DevOps Pipeline for Rapid Delivery and P...
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Microservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get StartedMicroservices Tutorial for Beginners | All You Need to Get Started
Microservices Tutorial for Beginners | All You Need to Get Started
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolith
 
Redis and Kafka - Advanced Microservices Design Patterns Simplified
Redis and Kafka - Advanced Microservices Design Patterns SimplifiedRedis and Kafka - Advanced Microservices Design Patterns Simplified
Redis and Kafka - Advanced Microservices Design Patterns Simplified
 
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
Redis and Kafka - Simplifying Advanced Design Patterns within Microservices A...
 
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
Alex Thissen (Xpirit) - Een verschuiving in architectuur: op weg naar microse...
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
 
Best Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with MicroservicesBest Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with Microservices
 
Regulated Reactive - Security Considerations for Building Reactive Systems in...
Regulated Reactive - Security Considerations for Building Reactive Systems in...Regulated Reactive - Security Considerations for Building Reactive Systems in...
Regulated Reactive - Security Considerations for Building Reactive Systems in...
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration Patterns
 
Application Darwinism - Why Most Enterprise Apps Will Evolve to the Cloud
Application Darwinism - Why Most Enterprise Apps Will Evolve to the CloudApplication Darwinism - Why Most Enterprise Apps Will Evolve to the Cloud
Application Darwinism - Why Most Enterprise Apps Will Evolve to the Cloud
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKS
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Continuous delivery by sergey seletsky
Continuous delivery by sergey seletskyContinuous delivery by sergey seletsky
Continuous delivery by sergey seletsky
 
IBM Managing Workload Scalability with MQ Clusters
IBM Managing Workload Scalability with MQ ClustersIBM Managing Workload Scalability with MQ Clusters
IBM Managing Workload Scalability with MQ Clusters
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Developing reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKS
 

Recently uploaded

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

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
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Resilient microservices

  • 2. Maxim Shelest Architect at PAYBACK GmbH #architect #developer #programmer #software- craftsman #life-long-learner #leader #agile- practitioner Lormem ipsum Microservices & resilience 2
  • 3. https://source.superherostuff.com/wp-content/uploads/2015/09/IEVaULq.png • Microservice(s) is in production or will be in production soon • Clear separated business capabilities between microservices using DD principles • Automated continuous deployment pipeline • DEVOPS culture • Monitoring and alerting with detailed dashboards About to launch a project Microservices & resilience 3
  • 4. Does “feature complete” mean “production ready”? ? Microservices & resilience 4
  • 5. Anything that can go wrong will go wrong. Murphy's law Microservices & resilience 5
  • 6. Resilience "Resilient systems provide and maintain an acceptable level of service in face of faults (unintentional, intentional, or naturally caused) affecting their normal operation" Microservices & resilience 6
  • 8. Do not forget resilience during estimations. Where resilience begins? Microservices & resilience 8 It is not only about Microservices!
  • 9. • recovery • retry: very basic recovery mechanism • self-healing: reinitialize components, either internally or by an external monitoring system (automatic service restart, start service upon machine boot) • retry budget: if the retry budget is exceeded, don’t retry; just fail the request to omit overloading (see circuit breaker) • exponential backoff with jitter: use randomized exponential backoff when scheduling retries • bulkheads: partition your systems, so that you can keep a failure in one part of the system from destroying everything • complete parameter checking: protection from broken / malicious calls (Postel’s law: be liberal in what you accept, and conservative in what you send) • asynchronous communication (sender does not need to wait for receiver's response) • event driven (event notification, event-carried state transfer, event-sourcing, CQRS) • location transparency: sender does not need to know receiver’s concrete location • zero downtime deployment: deployment is a bad reason for user facing unavailability • stateless (service failover is hard with state) Resiliency patterns (1) Microservices & resilience 9
  • 10. • relaxed temporal constraints: use a more relaxed consistency model to reduce coupling. The real world is not ACID, it is BASE. • idempotence • self contained deployment: services are self-contained deployment units (compatibility between dependent components/APIs) • timeouts • circuit breakers: prevent a failure from constantly recurring • failover • fallback/graceful degradation: The ability of maintaining functionality when portions of a system break down • error handler: separate business logic and error handling • fail fast: add checks in front of expensive operations, avoid foreseeable failures, also called Handshaking) • fan out & quickest reply: send request to multiple workers - use quickest reply and discard all other responses • bounded queues: avoids latency due to overloaded resources (use thread pools and connection pools) Resiliency patterns (2) Microservices & resilience 10
  • 11. • shed load: shed requests based on resource load • observability: goal is to automatically act on detected failures • monitoring: • health checks, • synthetic transactions, • monitor metrics • alerting/visualization • distributed systems tracing • log aggregation/analytics Resiliency patterns (3) Microservices & resilience 11 Always think about composition of patterns to achieve resilience
  • 12. Synchronous vs Asynchronous Microservices & resilience 12 Do not use synchronous communication! Asynchronous is better! The event-based or event-driven approach is a de facto worldwide standard for implementation of asynchronous communication in microservices architectures.
  • 13. Synchronous vs Asynchronous Microservices & resilience 13 Do not use synchronous communication! Asynchronous is better! The event-based or event-driven approach is a de facto worldwide standard for implementation of asynchronous communication in microservices architectures. Order Service Shipping Service shipNewOrder produce Order message broker consume Order
  • 14. "But we need to query data from other Microservice?" ? Microservices & resilience 14
  • 15. Command Query Responsibility Segregation Microservices & resilience 15 Order Service Customer Service produce Order message broker Customer View Service produce Customer Customers Orders findHighValueCustomers Customers Orders
  • 16. 16 "But we still need to connect to other systems synchronously, for example using HTTP(S)!"
  • 17. Important resilience patterns implementing HTTP client Microservices & resilience 17 Timeouts Retry Retry budget
  • 18. Important resilience patterns implementing HTTP client Microservices & resilience 18 Timeouts Retry Retry budget Exponential backoff Circuit breaker
  • 19. Important resilience patterns implementing HTTP client Microservices & resilience 19 Timeouts Retry Retry budget Exponential backoff Circuit breaker Bulkheads Shed load
  • 20. Important resilience patterns implementing HTTP client Microservices & resilience 20 Timeouts Retry Retry budget Exponential backoff Circuit breaker Bulkheads Shed load Fail fast Fan out & quickest reply Caching
  • 21. Important resilience patterns implementing HTTP client Microservices & resilience 21 Timeouts Retry Retry budget Exponential backoff Circuit breaker Bulkheads Shed load Fail fast Fan out & quickest reply Caching Observability Monitoring Alerting Tracing Log aggregation
  • 22. Build for production and not for test environment. 22 Remember TANSTAAFL: there ain’t no such thing as a free lunch.
  • 23. Do not over engineer your system! "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan Lormem ipsum Microservices & resilience 23
  • 24. Learn from production problems! • “The cost of failure is education (Devin Carraway)”. • Use blameless postmortems (https://landing.google.com/sre/book/chapters/postmortem-culture.html) • Human error is never a root cause! • Resilience should be a 4th management objective, alongside Better/Faster/Cheaper. Microservices & resilience 24