You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with horizontal scaling of our app without cluster mode. AWS ElastiCache supports up to 5 read replicas with one read/write primary node.
Question: how to use read replicas with go-redis library?
I've tried different client modes that go-redis library provides:
NewClusterClient can't be used in non-cluster mode. Error like "ERR This instance has cluster support disabled" is returned
NewSentinelClient/NewFailoverClient can't be used as Sentinel commands are not available: "ERR unknown command 'sentinel', with args beginning with: 'get-master-addr-by-name' 'master'"
The only approach worked so far is to use 2 or more NewClient connections. And then manually decide which commands goes where. I'm using a hook inside primary client connection for that. However it is not reliable, need much of manual checks and custom code.
Is there a better way? Is there built in solution?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm experimenting with horizontal scaling of our app without cluster mode. AWS ElastiCache supports up to 5 read replicas with one read/write primary node.
Question: how to use read replicas with go-redis library?
I've tried different client modes that go-redis library provides:
The only approach worked so far is to use 2 or more NewClient connections. And then manually decide which commands goes where. I'm using a hook inside primary client connection for that. However it is not reliable, need much of manual checks and custom code.
Is there a better way? Is there built in solution?
Beta Was this translation helpful? Give feedback.
All reactions