I am using Predis to connect to a Redis 3.0.2 cluster. So, I have an option to use either predis
or redis
cluster strategy. I am wondering if there are any significant pros and cons of choosing one of them over the other?
Based on my wandering through documentation, I have these couple of points in my mind, but I am not sure if my understanding is correct:
When using
redis
strategy, we don't have to list every node of our cluster while establishing a connection. Reference (Possibly a pro :) )When using redis-cluster, it is not necessary to pass all of the nodes that compose your cluster but you can simply specify only a few nodes
Next line of the article linked above says:
Predis will automatically fetch the full and updated slots map directly from Redis by contacting one of the servers.
Could it be a con in terms of performance? Because Predis will need to fetch some data from server before deciding which node to select for current read/write operation?
Context:
We are planning to use Redis to store PHP sessions. It is an AJAX heavy web application with thousands of active users at peak times. That's why we want to spread load across multiple Redis nodes. We will be happy to manually maintain the list of server addresses in connection establishment code in order to use predis
strategy if it is expected to offer significantly better performance as compared to redis
strategy for this specific use case.