Redis cluster client built on top of redigo


I published redisc to github, a redis cluster client built as a layer on top of redigo (it calls redigo to execute commands, redisc only manages the cluster-specific details):

Among interesting features:

  • the Cluster type can be a drop-in replacement for redis.Pool in simple cases or when keys have been carefully named for use in a cluster (using hash tags)
  • the connections are redis.Conn interfaces, meaning the API is exactly the same as when using redigo
  • all redis cluster-supported commands can be executed, including pub-sub, transactions and scripting (examples in the godoc)
  • smart routing (the cluster keeps track of which node serves which slot, and automatically updates the mapping on MOVED replies)
  • call RetryConn to get a connection that automatically retries when redis returns MOVED, ASK or TRYAGAIN errors
  • possibility to explicitly bind a connection to a node ahead of use, instead of relyiing on the detection of the key (useful when the command doesn’t have a key or when the key is not the first parameter)

See the godoc for full details:

Martin Angers

1 Like

I added support for READONLY/READWRITE (read from replicas) for this redis cluster client package, via a call to conn.ReadOnly().



This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.