Best Practice for Re-establishing Connection After Redis Datastore Down #95
Replies: 1 comment 1 reply
-
For second one about multiple connection is: I dont think that having multiple connection is that bad of an idea. I think that having 100 connections shout be of no problem, but going with number of connections over 1000 will require appropriate testing so that your infrastructure supports this. (use account can be limited by number of connection can single app establish). In terms of interface you can for example extend exiting class Connection that reconnects transperently.. Once there is a disconnection, you can just open new one and resume your work over new one with same extended class. (however, you will need to notify all existing outbound packet receivers, about an error, given that they are expecting rx.) |
Beta Was this translation helpful? Give feedback.
-
Hi,
Trying to figure out the best way to maintain a service's connection to Redis in scenarios where a Redis datastore has been restarted.
In my current service code, I simply create one Redis client connection and use that single client throughout the service's lifetime. But, in scenarios where the Redis datastore the client is connected to is restarted, then any followup client calls will cease to work as the connection will have been broken.
Therefore, I am wondering what would be best practice when using this dart Redis library in order to automatically re-establish the client's lost connection.
The other option would be to simply create a new Redis client connection for each new incoming service call but I don't how efficient and performant this would be in comparison if the service usage is high?
Any advise is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions