Closed L3o-pold closed 5 years ago
Hi @L3o-pold, this package targets Redis Sentinel, not Redis Cluster. The terminology is a bit confusing at first.
Sentinel implements a replication strategy that effectively mirrors all the data in one Redis master server to n replicas for high availability and load balancing. If the master server fails, Sentinel promotes one of the replicas to take over. This package abstracts the Sentinel connection protocol so that a Laravel application doesn't need to handle the server selection and fail-over manually.
By contrast, Cluster provides a way to automatically shard a unified dataset between multiple Redis servers to allow for greater storage than one server might hold in memory. We can also configure Cluster for high-availability, but these details are on the Redis side--a Laravel application doesn't need to know about the replication topology like it does with Sentinel.
An application can also manually shard its dataset in a Sentinel setup (via client-side sharding), but there is little benefit to this approach when we have the option to use Redis Cluster. Sentinel is a good choice for applications that benefit from high availability without a great need for storage space. Most Laravel applications fit this use case: the default cache, session, and queue services turn over transient data that doesn't need to be stored for an extended period of time.
Laravel already supports Redis Cluster out-of-the-box. This package enhances the support for Sentinel. If you're using Redis Cluster only, you don't need this package.
Hi @cyrossignol, thank you for your great explanation. You right I was confused about the terminology and intended to used both cluster and sentinel at the same time.
Is this package compatible with redis clustering?
I got the following error.
Predis\\Response\\ServerException MOVED 6918 x.x.x.x:6379
Am I missing something?
routes/web.php