You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Laravel’s database.redis.client setting applies globally. This means that all Redis connections defined under the database.redis configuration key must use the same client (e.g., predis, phpredis, etc.).
Problem
In projects where multiple Redis servers serve different roles, this limitation creates challenges. For example, in our case:
Stateless Redis – used for locks, cache, sessions, and Prometheus metrics.
Stateful Redis – used for Laravel Queues (via Laravel Horizon), requiring Redis Sentinel for high availability and persistence.
With the current implementation of \Illuminate\Redis\RedisManager, it’s not possible to assign different clients (drivers) to different connections. This prevents us from configuring one Redis connection with a lightweight client for stateless operations, while another uses a Sentinel-aware client for queues.
Proposal
Introduce the ability to optionally set the Redis client per connection.
Keep the existing global database.redis.client setting as the default.
Allow overriding the client driver at the individual connection level when defined in database.redis.
This would provide developers with flexibility to tailor Redis connections based on their role, availability requirements, and client capabilities, without breaking backward compatibility.
Benefits
Enables mixed Redis setups within the same Laravel application using different Redis clients for different purposes.
Maintains backward compatibility, since the global database.redis.client remains as the fallback.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, Laravel’s
database.redis.client
setting applies globally. This means that all Redis connections defined under thedatabase.redis
configuration key must use the same client (e.g.,predis
,phpredis
, etc.).Problem
In projects where multiple Redis servers serve different roles, this limitation creates challenges. For example, in our case:
With the current implementation of
\Illuminate\Redis\RedisManager
, it’s not possible to assign different clients (drivers) to different connections. This prevents us from configuring one Redis connection with a lightweight client for stateless operations, while another uses a Sentinel-aware client for queues.Proposal
Introduce the ability to optionally set the Redis client per connection.
database.redis.client
setting as the default.database.redis
.This would provide developers with flexibility to tailor Redis connections based on their role, availability requirements, and client capabilities, without breaking backward compatibility.
Benefits
database.redis.client
remains as the fallback.Beta Was this translation helpful? Give feedback.
All reactions