Resilience
Most, if not all, of the systems we develop nowadays require the cooperation of other services, which may live in the same process, on the same machine, or may require some network communication. This creates a lot of different potential scenarios where things may fail. Resilience is the ability of your system to act in an organized way when those events occur.
Your particular approach to resilience depends on multiple factors. Is it possible to try that request again? Should the administrator be alerted if the detected error is fatal? Instead of predefined answers, Arrow aims to provide a set of tools that you can use to architect your solution in a concise and composable way.
All the resilience mechanisms described in this section are part of the arrow-resilience library.
Retry and repeat
Retry and repeat computations using Schedule
Circuit breaker
Protect other services from being overloaded
Saga
Implement transactional behavior in distributed systems
The following videos showcase how to introduce resilience in your applications.
- Functional Programming in Kotlin with Arrow by Simon Vergauwen and Alejandro Serrano
- Building applications with Kotlin and Arrow.kt in style by Simon Vergauwen
If you want to know more about these patterns, you can check some of these guides:
- A pattern language for microservices
- Cloud design patterns (the documentation talks about Azure, but its insights are widely applicable.)