go-gorm / go-gorm/dbresolver

Fallback Policy for Replicas

Open
#47 0 comments 0 reactions 1 assignee Claimed by @jinzhu View on GitHub
Dominant language
Go
Stars
538
Forks
69
PR merge metrics
No merged PRs in 30d

Description

## Describe the feature

Currently only available policy is random. We need a fallback policy where incase first replica fails we need to fallback to second replica.

Eg.
Source: M1 (master 1)
Replicas: R1 (Replica 1), R2 (Replica 2)

* Normal Scenario - Writes Served by M1, Reads Served by R1
* Disaster Master Down - Writes don't work, Reads Served by R1
* R1 Promoted to Master (R1 becomes M1) - Writes Served by M1, Reads Fail.
In this Scenario we want Reads to Shift to R2.

First two scenarios are currently handled we need fallback policy for third scenario.

We have replicas which would be in process of updation to master in case of a disaster. Thus first replica may become unavailable while second replica continues to function. In such scenario a Fallback policy would be required.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.