SlideShare a Scribd company logo
Senior Technical Lead, WSO2
Resilience Patterns with Ballerina
Isuru Udana
Bob is a developer who
works at the IT
Department of a
popular bank.
Bob
Bob was asked to develop
a mobile selfcare banking
application.
This mobile application
should be capable of
showing account balances
as well as details of past
transactions.
Legacy services are
already available.
But when he started to implement the application,
bob found issues with some of the legacy services.
Transient
Network Failures
Moderate Load
Intermittent
Failures
Bob found it very
difficult to build a
reliable application.
Resilient service
Bob got an idea!
Resilience
Ability to return to the
original form, position after
being affected by a particular
alteration
What is Resilience?
In a software system, resilience means ...
… the ability to recover to a working condition after being
affected by a serious incident
Resilience in Software Applications
“The probability of failure-free software operation for a
specified period of time in a specified environment.”
- The IEEE Reliability Society
• 100% operational all the time
Reliability and Resilience
Reliability
http://www.picserver.org/r/reliability.html
Focusing on Reliability is Enough...?
Distributed and complex systems
with many interactions are prone
to failures
Why Focusing on Reliability is Not
Enough
Systems are Complex and Prone to Failures
• Untested corner cases
• Minor mistakes can affect serious production
incidents
• Failures are unpredictable
Why Focusing on Reliability is Not
Enough
Avoiding Failures is Not Practical
• Handle unexpected situations
• When one feature is temporarily unavailable, the rest
of the application still runs
• Stop propagating errors happening at downstreams of
a complex system into upstreams
Resilience in Production
It’s All About Achieving
Availability of a Production
System!
Best case:
• User get’s a 100% availability of the
service
Typical case:
• User sees a graceful degradation of the
service
What Does it Mean to a User?
• Never expect systems to be 100% reliable
• Design systems thinking about connection issues,
down times, etc.
What Does it Mean to a developer ?
• Bulkhead
• Retry
• Circuit Breaker
• Timeout
• …
Resilience Patterns
Isolate components of an application into multiple pools.
If one component fails, others will continue to service
Bulkhead
Isolation
• Transient failures are not uncommon
• They recover by themselves
• Can be handled by
– Cancel
– Retry
– Retry with a delay
Retry
https://www.flickr.com/photos/markgregory/8184890333
https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode
• Hide downstream latency and keep
the responsiveness to upstream
• Prevent waiting forever
Timeout
• Some transient failures takes
much longer to recover
• Repeatedly retrying may
hinder recoverability
• Retry up to a certain degree
and cut off
Circuit Breaker
Circuit Breaker
Fail/Keep Open
Reset Timeout
Fail
Success
Fail
(threshold not reached)
Fail
(threshold exceeded)
Success
Open
Half-OpenClosed
States in
circuit breaker
Resilience with Ballerina
• Designed to implement resilient programs/services
• Highly structured error and exception handling
Resilience with Ballerina
Back to the Story
Banking Service
Banking
Service
Account
Balance Service
Account
History Service
Mobile
Application
Can only handle
moderate load
Transient Failures
Sometimes takes a
long time to respond
Banking Service Account Balance
Legacy Service
Account
History
Legacy
Service
Account
Balance
Resource
Account
History
Resource
Banking Service
Account
Balance
Resource
Account
Balance Legacy
Service
Connectors, Connections and Endpoints
Endpoint
Connection
Params
Connector Options
Struct
Handling Transient Failures
Retry
Banking
Service
Account
Balance Service
Mobile
Application
Handling Transient Failures
Retry
Retry
Count
Retry
Delay
Options
Struct
Timeout
Timeout
Duration
Protect Services From Overload
Circuit Breaker
Retries Before
Suspension
Suspension
Duration
Applying Multiple Patterns
Circuit Breaker + Retry + Timeout
Circuit
Breaker
Retry
Timeout
Balancing Load
Banking
Service
Account
Balance Service 1
Mobile Application
Account
Balance Service 2
Balancing Load
Connectors
Story Continued ...
For priority
customers,
application should
provide zero
downtime.
Offering Different Quality of Services
Bulkhead
Banking
Service
Reliable
Service
Service got
Transient
Failures
Standard
Customer
Priority
Customer
Offering Different Quality of Services
Bulkhead
Reliable
Service
Service with
Transient Issues
Priority
Check
Function
Conclusion
● What is Resilience
● Reliability and resilience
● Resilience patterns
● Building resilience patterns with Ballerina
wso2.com

More Related Content

PDF
WSO2Con EU 2016: Understanding Microservice Architecture
PPTX
Introduction to microservices
PDF
WSO2Con USA 2017: Providing a Pathway from Stovepipe Systems to a Secure SOA ...
PDF
WSO2Con EU 2016: Building Enterprise Apps Using WSO2 Platform
PDF
WSO2Con USA 2017: Implement an Effective Digital Platform Using WSO2 Integration
PDF
WSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
PDF
Microservices: Where do they fit within a rapidly evolving integration archit...
PDF
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클
WSO2Con EU 2016: Understanding Microservice Architecture
Introduction to microservices
WSO2Con USA 2017: Providing a Pathway from Stovepipe Systems to a Secure SOA ...
WSO2Con EU 2016: Building Enterprise Apps Using WSO2 Platform
WSO2Con USA 2017: Implement an Effective Digital Platform Using WSO2 Integration
WSO2Con USA 2017: Introduction to Security: End-to-End Identity Management
Microservices: Where do they fit within a rapidly evolving integration archit...
12월 16일 Meetup [Deep Dive] Microservice 트래픽 관리를 위한 Istio 알아보기 | 강인호 컨설턴트, 오라클

What's hot (20)

PDF
Microservices: an introduction
PDF
Introduction to Microservices
PPTX
Developing Enterprise Applications with the WSO2 Application Platform
PDF
Delivering the Promise of SOA - Enterprise Integration Made Easy
PDF
WSO2Con EU 2016: Understanding the WSO2 API Management Platform
PDF
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
PDF
[WSO2Con EU 2017] Keynote: Ballerina Plans and Futures
PPTX
Introduction To Microservices
PDF
170215 msa intro
PPTX
Microservice architecture : Part 1
PPTX
From SOA to MSA
PDF
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
PDF
Using a private cloud to automate and govern enterprise development
PDF
WSO2 and 2 Degrees Case Study
PDF
Building Microservices: Designing Fine-Grained System by Sam Newman
PDF
Microservice Architecture 101
PPTX
Soa 22 software as a service and soa
PPTX
Enhancing Unified Communication Experience through Microsoft Lync SDK and UCMA
PPTX
Introduction to Microservices
PPTX
Do you need microservices architecture?
Microservices: an introduction
Introduction to Microservices
Developing Enterprise Applications with the WSO2 Application Platform
Delivering the Promise of SOA - Enterprise Integration Made Easy
WSO2Con EU 2016: Understanding the WSO2 API Management Platform
[WSO2Con EU 2017] Ballerina Connectors for Seamless Integration
[WSO2Con EU 2017] Keynote: Ballerina Plans and Futures
Introduction To Microservices
170215 msa intro
Microservice architecture : Part 1
From SOA to MSA
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
Using a private cloud to automate and govern enterprise development
WSO2 and 2 Degrees Case Study
Building Microservices: Designing Fine-Grained System by Sam Newman
Microservice Architecture 101
Soa 22 software as a service and soa
Enhancing Unified Communication Experience through Microsoft Lync SDK and UCMA
Introduction to Microservices
Do you need microservices architecture?
Ad

Similar to [WSO2Con EU 2017] Resilience Patterns with Ballerina (20)

PDF
Resisting to The Shocks
PDF
The 7 quests of resilient software design
PDF
Why resilience - A primer at varying flight altitudes
PDF
Reliability and Resilience Patterns
PDF
Architecting for Failures in micro services: patterns and lessons learned
PDF
Resilience Planning & How the Empire Strikes Back
PPTX
Microservices Resilient Engineering - Java meetup.pptx
PPTX
Resilience reloaded - more resilience patterns
PDF
Expect the unexpected: Prepare for failures in microservices
PPTX
Resilience planning and how the empire strikes back
PPTX
Expect the unexpected: Anticipate and prepare for failures in microservices b...
PDF
Latency Control And Supervision In Resilience Design Patterns
PDF
When Things Go Bump in the Night
PDF
Devoxx2017
PDF
Patterns and practices for building resilient serverless applications
PDF
Patterns and Practices for Building Resilient Serverless Applications
PPTX
Designing apps for resiliency
PPTX
Cloud architecture
PDF
Architectural Patterns of Resilient Distributed Systems
PPTX
Stability Patterns for Microservices
Resisting to The Shocks
The 7 quests of resilient software design
Why resilience - A primer at varying flight altitudes
Reliability and Resilience Patterns
Architecting for Failures in micro services: patterns and lessons learned
Resilience Planning & How the Empire Strikes Back
Microservices Resilient Engineering - Java meetup.pptx
Resilience reloaded - more resilience patterns
Expect the unexpected: Prepare for failures in microservices
Resilience planning and how the empire strikes back
Expect the unexpected: Anticipate and prepare for failures in microservices b...
Latency Control And Supervision In Resilience Design Patterns
When Things Go Bump in the Night
Devoxx2017
Patterns and practices for building resilient serverless applications
Patterns and Practices for Building Resilient Serverless Applications
Designing apps for resiliency
Cloud architecture
Architectural Patterns of Resilient Distributed Systems
Stability Patterns for Microservices
Ad

More from WSO2 (20)

PDF
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
PDF
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
PDF
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
PDF
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
PDF
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
PDF
Platformless Modernization with Choreo.pdf
PDF
Application Modernization with Choreo for the BFSI Sector
PDF
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
PDF
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
PPTX
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
PPTX
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
PPTX
WSO2Con 2025 - Building Secure Customer Experience Apps
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
PPTX
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
PPTX
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
PPTX
WSO2Con 2025 - Architecting Cloud-Native Applications
PDF
Mastering Intelligent Digital Experiences with Platformless Modernization
PDF
Accelerate Enterprise Software Engineering with Platformless
PDF
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Demystifying CMS-0057-F - Compliance Made Seamless with WSO2
Quantum Threats Are Closer Than You Think – Act Now to Stay Secure
Modern Platform Engineering with Choreo - The AI-Native Internal Developer Pl...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Platformless Modernization with Choreo.pdf
Application Modernization with Choreo for the BFSI Sector
Choreo - The AI-Native Internal Developer Platform as a Service: Overview
[Roundtable] Choreo - The AI-Native Internal Developer Platform as a Service
WSO2Con 2025 - Building AI Applications in the Enterprise (Part 1)
WSO2Con 2025 - Building Secure Business Customer and Partner Experience (B2B)...
WSO2Con 2025 - Building Secure Customer Experience Apps
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - AI-Driven API Design, Development, and Consumption with Enhanc...
WSO2Con 2025 - Unified Management of Ingress and Egress Across Multiple API G...
WSO2Con 2025 - How an Internal Developer Platform Lets Developers Focus on Code
WSO2Con 2025 - Architecting Cloud-Native Applications
Mastering Intelligent Digital Experiences with Platformless Modernization
Accelerate Enterprise Software Engineering with Platformless
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Approach and Philosophy of On baking technology
PDF
Modernizing your data center with Dell and AMD
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced IT Governance
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Empathic Computing: Creating Shared Understanding
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Approach and Philosophy of On baking technology
Modernizing your data center with Dell and AMD
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Weekly Chronicles - August'25 Week I
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced IT Governance

[WSO2Con EU 2017] Resilience Patterns with Ballerina