How to leverage Elasticache global replication group with read replica cluster(s) #3209
Unanswered
WilliamDeBruin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We manage an Elasticache Global Replication Group with a primary cluster in one region and read replicas in other regions. Except in the case of regional failover, the replication group is not used at all since all applications require both Redis reads and writes. I'd like to wrap or add a hook to our Redis client to enable read-only commands to be routed to the replica cluster and write commands to be routed to the primary cluster. Replication lag between primary and replication clusters is not a concern.
My first thought was to use a hook, however it does not like the hook interface exposes anything that would allow read commands to be routed to a different Redis client.
My next thought was to leverage embedding to allow a struct wrapped around a redis client to intercept and reroute selected methods.
Is there an easier or more idiomatic way to accomplish this without defining the entire
UniversalClient
interface?Beta Was this translation helpful? Give feedback.
All reactions