https://github.com/societe-generale/failover
A generic lib to manage the failover on external referential service
https://github.com/societe-generale/failover
failover fallback recovery resilience
Last synced: 3 months ago
JSON representation
A generic lib to manage the failover on external referential service
- Host: GitHub
- URL: https://github.com/societe-generale/failover
- Owner: societe-generale
- License: apache-2.0
- Created: 2022-10-13T09:47:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-17T07:28:44.000Z (almost 2 years ago)
- Last Synced: 2024-05-07T18:05:45.428Z (over 1 year ago)
- Topics: failover, fallback, recovery, resilience
- Language: Java
- Homepage: https://societe-generale.github.io/failover
- Size: 3.65 MB
- Stars: 7
- Watchers: 6
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README

# **Failover**

[](https://codecov.io/gh/societe-generale/failover)
[](https://www.codacy.com/gh/societe-generale/failover/dashboard?utm_source=github.com&utm_medium=referral&utm_content=societe-generale/failover&utm_campaign=Badge_Grade)
[](https://maven-badges.herokuapp.com/maven-central/com.societegenerale.failover/failover)
[](https://central.sonatype.com/artifact/com.societegenerale.failover/failover)
[](https://sourcespy.com/github/societegeneralefailover/)
> ***Failover library - To manage the failover on referential systems*****"This library is to help to enable a failover to handle the failures on external services by keeping a local store for such api responses"**
- Support **Failover** needs for your domain services
- Simple to use by simply annotating with **@Failover(name="client-by-id")**
- Support for various failover store **Inmemory**, **Caffeine**, **Jdbc** etc
- Support for various failover execution **Basic**, **Resilience** etc
- Easy to **customize** and use by providing your own **Expiry Policy**, **Failover Store**, **RecoveredPayloadHandler** or many other providers---
## Spring Boot Starter Dependency
You can configure the failover module with your project by adding the below starter dependency and the configurations
```pom.xml
com.societegenerale.failover
failover-spring-boot-starter
```For more details, please go to [Getting Started](https://societe-generale.github.io/failover/#/documentation/quick-start)
---

---
## Key Features

- **A light framework ( Domain and Core modules )** : No external frameworks ( Just by @Failover Annotation )
- Easy integration with any jvm base project with no spring framework.
- **Spring Boot Starter** : Spring boot starter for easy spring integration
- **Failover Execution Strategy** : ( Eliminate tightly coupling with other frameworks )
- With simple Try Catch ( No heavy framework )
- Support for resilience4j-circuitbreaker
- Easily pluggable architecture for custom Failover Execution Strategy
- **Failover Store** :
- In-memory : Not recommended for production
- Cache : With caffeine cache ( for very small-scale use case )
- JDBC : For any database support ( recommended for most common use cases )
- CUSTOM : For any other custom failover store
- **Failover Expiry Policy** :
- With simple time duration ( SECONDS, MINUTES, HOURS, DAYS, etc. )
- Custom expiry policy : Team can configure any specific custom expiry policy for their need. Ex: For not to expire on weekends
- **Monitoring** : Various failover metrics are available for effective monitoring
- **Failover Configuration Dashboard** : Shows all configurations on failover
- **Failover Rates** : Shows overall failover on external service call
- **Failover Recovery Rates** : Shows recovery on failover
- **Failover NonRecovery Rates** : Shows non recovery on failover ( actual impact or exception on application )
---
## Use case### Context
In microservice architecture, many types of microservices are present in a platofrm. In this example, we have 3 category of microservices.1. **Internal Microservices** :
- Full ownership is with the application teams.
- If there is any issue in Internal Services, the team has full control of it and easy to improve.
2. **Transversal Services** :
- Ownership is not with application team, but managed by other teams in the organization.
- If there is any issue in such service, the application team has to escalate the issues with the respective owners/teams and wait for the resolution. Most of the time this take some time.
3. **External Service** :
- Ownership is with external organization
- If there is any issue in such service, the application team has to escalate the issues with the respective teams in other organization and wait for the resolution. Most of the time this take some time.
### Scenario
**When a referential services having some issues where the application teams does not have a control ?**
- In such condition, the impact will be cascaded to each applications.
- If referential service is down, the application will have some exception. ( *500 : Internal Server Error* )
- If the referential service is slow, our application will also have the slowness.### Solution
- Apply **failover**
- Define the expiry for each referential **with the acceptance of business**
- Define **acceptable expiry policy**
### Benefit
The solution **will not eliminate such failures completely (not 100%)**.
However, this will help us to **reduce the impact** on the business on a large scale.
---
## MONITORING
The failover lib comes with good monitoring metrics which help the teams to understand the various insights of overall failures on the application
### Failover Configuration Dashboard

> For this dashboard, you must provide below configuration :
```yaml
failover:
package-to-scan: # Your base package where @Failover annotations are declared
```### Failover Rates
### Failover Recovery Rates
### Failover NonRecovery Rates
---
## Code Owners
- [Anand MANISSERY](https://github.com/anandmnair)## Thanks and acknowledgement
- [Vincent FUCHS](https://github.com/vincent-fuchs)
- Patrice FRICARD
- Igor LOVICH
- Abilash TITUS
---