Is there a way to connect to the Redis Cache Cluster Node by providing the Node endpoint? Which library should I use for this?
Also, which API should I use to store and retrieve contents from the Cache?
It depends.
You can connect to Redis Cluster nodes without command dispatching to other nodes. You just should make sure, that you access keys that are handled by the node. If you are connecting to a slave make sure, that your connection is in READONLY mode, otherwise the slave will respond with MOVED.
There are plenty of Java-based Redis Clients:
Low Level
High Level
...and many more. You can find a more comprehensive list of Java Redis Clients at http://redis.io/clients#java
Which client should you take?
Well, this depends mostly on your requirements. If you need "just a client" for short-lived connections, then perhaps Jedis is the right choice for you. If you need flexibility, async responses and custom codecs, then lettuce might be your friend.
If you want to deal with Java Collections, Locks and many more, then take a look on Spring Data Redis or Redisson.
Which API should you take?
Depends also on your requirements. The Redis protocol might be more flexible than the memcached protocol since Redis supports more data structures.
HTH, Mark
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With