We are currently using Redis as our data store. I am making a new section where we need to rank and paginate users. So i am thinking to use Sorted set for keeping rank and userid. And Hash for keeping user's profile data. It was brought to my attention by a colleague that we ll need to make many requests to redis to fetch users profile data using HGET. so Round trip time is going to be an issue. I was planning to use HMGET but After doing some research i found it may cause issues when Redis is clustered because Keys are stored in different redis nodes. I am using phpredis it has client side-sharding (I am having trouble understanding what that is).
i was thinking to do like this:
rank
zadd userRank 1 5
zadd userRank 2 2
zadd userRank 3 4
zadd userRank 4 3
userProfile
hset userProfile user:5 "{'userId':'5','name':'usera'}"
hset userProfile user:4 "{'userId':'4','name':'userb'}"
hset userProfile user:3 "{'userId':'3','name':'userc'}"
hset userProfile user:2 "{'userId':'2','name':'userb'}"
1) Will HMGET work normally in clustered Redis?
2) if not what can i do?
3) is there any better way to implement this?