tsukasaoishi / fresh_connection

FreshConnection provides access to one or more configured database replicas.
MIT License
58 stars 11 forks source link

Does this support failover? #29

Closed patrykk21 closed 6 years ago

patrykk21 commented 6 years ago

Hello, everyone,

Basically, what happens if one of the slave databases is unreachable for any reason? Would it fallback to another slave instance and/or would it fallback to master?

I think this information should be added to README.md.

LMK, thank you

Sorry if I created an issue for something that might not be one.

tsukasaoishi commented 6 years ago

Basically, what happens if one of the slave databases is unreachable for any reason? Would it fallback to another slave instance and/or would it fallback to master?

If a connection exception occurs, FreshConnection will try 3 retries to access to slave. If there are multiple slaves, FreshConnection assumes that there is a load balancer in front of them. Whether to use a different slave or not depends on the specification of that load balancer. FreshConnection expects that load balancer to failback during three retries.

I think this information should be added to README.md.

OK. I'll edit README soon.

tsukasaoishi commented 6 years ago

Edited README 4a3a6bd5e717b0fd91aa6832ee6c15d5e6faf25a