I think that there is something wrong with my Redis and web application deployment environment.
It would be grateful if someone could review my configurations and handle the case that I find tricky.
Redis configuration:
I have multiple Redis replicas configured, one as master and others as slaves. Let's say for simplification:
- server1: configured as master
- server2 ~ serverN: configured as slaves, referring to server1
Redis sentinel(s) may or may not be present in this structure, because I cannot guarantee that there will be at least servers.
In my situation, only server1 is guaranteed to exist, servers 2 to N are not.
Web application deployment environment:
I also have .NET web application(s) deployed using two connection strings, one for the master and another for one of the slaves. The web services use
The connection strings would look like this:
- "server1,password=myredispassword" for Redis master
- "serverN,password=myredispassword" for Redis slave
Of course, if a web application has a slave connection for serverN, then serverN is guaranteed to exist.
Problem Situation (and Question):
Now I think it would be possible to have a situation where there is a fallen Redis replica (master or slave), and my web application is referring to that fallen Redis replica via a connection string.
I presume that in such case the web application would go down, saying that the endpoint is unreachable.
Is it possible to gracefully handle the unreachable endpoint replica to another that is reachable? Do I need to configure Redis sentinels in order to do this? Or would you even say that my approach in trying to access or handle Redis connection is not correct? Thanks in advance for your opinion.