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

Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
 
K8s on AWS - Introducing Amazon EKS
K8s on AWS - Introducing Amazon EKSK8s on AWS - Introducing Amazon EKS
K8s on AWS - Introducing Amazon EKSAmazon Web Services
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservicesAnthony Martin
 
CAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeDilum Bandara
 
Service Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioService Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioMichelle Holley
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsUwe Friedrichsen
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Chris Richardson
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfamanmakwana3
 
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshService-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshChristian Posta
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices Bozhidar Bozhanov
 
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_have
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_haveHow_to_build_your_cloud_enablement_engine_with_the_people_you_already_have
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_haveAmazon Web Services
 
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018Amazon Web Services
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesAraf Karsh Hamid
 

What's hot (20)

Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
 
K8s on AWS - Introducing Amazon EKS
K8s on AWS - Introducing Amazon EKSK8s on AWS - Introducing Amazon EKS
K8s on AWS - Introducing Amazon EKS
 
Event driven microservices
Event driven microservicesEvent driven microservices
Event driven microservices
 
CAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain SyndromeCAP Theorem and Split Brain Syndrome
CAP Theorem and Split Brain Syndrome
 
Service Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioService Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with Istio
 
Sre summary
Sre summarySre summary
Sre summary
 
Resilience reloaded - more resilience patterns
Resilience reloaded - more resilience patternsResilience reloaded - more resilience patterns
Resilience reloaded - more resilience patterns
 
CI/CD on AWS
CI/CD on AWSCI/CD on AWS
CI/CD on AWS
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdf
 
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMeshService-mesh options with Linkerd, Consul, Istio and AWS AppMesh
Service-mesh options with Linkerd, Consul, Istio and AWS AppMesh
 
Deep Dive: Hybrid Architectures
Deep Dive: Hybrid ArchitecturesDeep Dive: Hybrid Architectures
Deep Dive: Hybrid Architectures
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_have
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_haveHow_to_build_your_cloud_enablement_engine_with_the_people_you_already_have
How_to_build_your_cloud_enablement_engine_with_the_people_you_already_have
 
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
 
Microservices Architecture & Testing Strategies
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
 
Setting Up a Landing Zone
Setting Up a Landing ZoneSetting Up a Landing Zone
Setting Up a Landing Zone
 

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 - 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
 
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
 
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 - 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...
 
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
 
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

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%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 masabamasaba
 
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-learnAmarnathKambale
 
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 EnvironmentVictorSzoltysek
 
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...Jittipong Loespradit
 
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..pdfPearlKirahMaeRagusta1
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%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 kaalfonteinmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 

Recently uploaded (20)

%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%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
 
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
 
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
 
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...
 
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
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%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
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
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
 

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