mohannadelemary/laravel-redis-connection-clients
A Laravel package that provides Redis connection client wrappers, making it easy to configure, resolve, and reuse multiple Redis connections across your application for cache, queues, sessions, and custom workloads. Simplifies connection setup and keeps Redis access consistent and organized in Larav...
This package is a narrow configuration extension for Laravel’s Redis layer: it allows a client key on individual Redis connections or clusters in config/database.php, overriding database.redis.client only for that connection. Architecturally, that is a low-coupling fit for Laravel applications that already use the framework’s Redis configuration and need mixed Redis clients without replacing the whole Redis stack.
Architecture fit: Good for targeted use cases such as one connection requiring predis while the default remains phpredis, or a custom client registered through Redis::extend(). It preserves Laravel’s existing Redis configuration model and avoids application-level client branching. The blast radius is intentionally limited to explicitly configured connections.
Integration feasibility: High. The integration appears config-only: add client to selected connections/clusters, keep the global default unchanged, and ensure the referenced client is available and registered before use. This is attractive for teams that want incremental adoption rather than a Redis abstraction rewrite.
Technical risk: Moderate for a v0.1.0 package. The feature is simple, but early-stage packages carry maintenance, documentation, and edge-case risk. Key technical concerns include behavior under config:cache, long-lived workers such as Octane, queue/Horizon/session connections that may implicitly depend on Redis client behavior, cluster-specific client differences, and registration order for custom clients via Redis::extend(). Compatibility is also constrained to Laravel 12 and 13 on PHP 8.3+, which may exclude otherwise valid environments.
Key questions:
client resolution behave correctly with php artisan config:cache and in Octane/long-running workers?phpredis, predis, and custom clients, or only partially?Redis::fake(), queue workers, Horizon, sessions, and cache stores?Stack fit: Strong for Laravel 12/13 applications on PHP 8.3+ that already configure Redis through config/database.php and need per-connection client control. It is not a general Redis abstraction layer and should not be positioned as one.
Migration path: Additive and low-risk. No data migration is required. Teams can keep the global database.redis.client unchanged, add client only to the specific connection that needs it, and validate that connection independently. This makes it suitable for a pilot on a non-critical connection before wider use.
Compatibility: Explicitly supports Laravel 12 and 13 on PHP 8.3+. Confirm that all target environments meet those constraints. Validate the exact Redis clients in use—phpredis, predis, or custom Redis::extend() clients—and confirm cluster support where relevant. Applications on older Laravel/PHP versions should treat this as unavailable unless they upgrade.
Sequencing:
client key.Maintenance: Low runtime maintenance if the package remains stable, because it is configuration-driven and narrowly scoped. However, v0.1.0 implies early maturity; teams should expect possible API/config changes and should pin the version until upgrade behavior is understood.
Support: Support risk is the main operational concern. A first release with limited adoption may have thin documentation and unclear long-term maintenance. TPM should establish ownership, upgrade cadence, and an internal fallback plan before relying on it for critical connections.
Scaling: The package should have negligible scaling impact because it affects client selection at connection configuration time, not request volume or data-path logic. Scaling risk is more about operational consistency: mixed clients across connections can create divergent behavior in pooling, clustering, timeout handling, and observability.
Failure modes: Likely failure modes include misconfigured client values, custom clients not registered before connection resolution, stale config caches, behavioral differences between phpredis and predis, cluster-specific incompatibilities, and confusion when only one connection diverges from the global default. These are detectable with connection-level smoke tests and clear configuration documentation.
Ramp-up: Low for Laravel teams already comfortable with config/database.php and Redis connections. Ramp-up increases for custom Redis::extend() clients or cluster setups, where engineers need to understand client registration order, cluster semantics, and Laravel’s Redis connection resolution. A short internal runbook covering supported clients, rollout scope, validation commands, and rollback steps is sufficient for most teams.
How can I help you explore Laravel packages today?