Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Redis Bundle

Redis Bundle Laravel Package

snc/redis-bundle

Symfony bundle integrating Predis and PhpRedis for a fast, convenient interface to Redis. Supports Symfony 6.4+. Native PhpRedis is recommended for performance, with Predis as a safe, portable alternative. Configure clients, sessions, caching, and profiling from one place.

View on GitHub
Deep Wiki
Context7

A Redis bundle for Symfony supporting Predis and PhpRedis

Frequently asked questions about Redis Bundle
What is snc/redis-bundle used for?
SncRedisBundle is a Symfony bundle that integrates the Predis library and the native PhpRedis extension into a Symfony application, giving you a fast and convenient interface to Redis. It provides config-driven, DSN-based management of multiple clients and connections plus support for single node, Sentinel, Cluster and RedisArray client-side sharding setups. Optional integrations cover the Symfony session handler, the cache component and the web profiler data collector.
Does snc/redis-bundle work with Laravel?
No. SncRedisBundle is a Symfony bundle, not a framework-agnostic PHP library: it ships a DI extension, compiler passes, service definitions and Symfony-specific integrations, and it targets Symfony 6.4+. Laravel already provides a client manager, multi-connection configuration and event hooks through Illuminate\Redis, so pulling in a Symfony container to obtain the same surface area is a poor architectural fit. It is only a strong choice for a genuinely Symfony application, or the Symfony side of a hybrid monorepo.
How do I install and configure snc/redis-bundle?
Install it with Composer using composer require snc/redis-bundle, then register the bundle in your Symfony application. Configuration is done in YAML under the snc_redis key, where you declare clients and connections using DSNs. The real prerequisite is runtime, not Composer: either the PhpRedis extension must be available in every environment (local, CI, container image, managed host), or you deliberately fall back to Predis.
Should I use PhpRedis or Predis with snc/redis-bundle?
The maintainers recommend the native PhpRedis extension, which is faster and is their main development platform. Predis is documented as a safe, portable alternative when the extension is not available and cannot be installed, and the integration is intended to be functionally identical. Relay is also supported as a fourth option, but each additional client adds another deployment variable you have to guarantee across local, CI and production.
Which Symfony and PHP versions does snc/redis-bundle support?
The bundle targets Symfony 6.4 and newer and installs cleanly on PHP 8.x. Because it tracks Symfony majors from 6.4 to 7 to 8, its upgrade cadence is chained to the framework's, and any Symfony major bump becomes a bundle-upgrade project. Pin the bundle and your Symfony version deliberately and plan the upgrade path for both together.
How do I configure multiple Redis clients and connections?
You declare clients and their connections in the bundle configuration, each pointing at a DSN, so a single application can talk to several Redis instances or logical databases. A client can be configured with more than one connection or an aggregation strategy, and you can then inject the specific client service where you need it. This DSN-first convention is useful as a reference implementation even if you are evaluating the bundle rather than adopting it.
Does snc/redis-bundle support Redis Sentinel, Cluster and sharding?
Yes. It supports single node, Sentinel, Cluster, and RedisArray client-side sharding across PhpRedis, Predis and Relay. Support depth varies by client: PhpRedis 6.x changed the Sentinel, Cluster and auth APIs, and TLS propagation to Sentinel was only fixed in 4.12, so verify the combination you plan to run. If you do not need Sentinel, Cluster or sharding now or within the next year, those features are complexity you may not want to pay for.
Can I use snc/redis-bundle for Symfony sessions, caching and profiling?
Yes. The bundle offers optional integrations for the Symfony session handler, the cache component and a web profiler data collector. The bundle itself flags Redis-backed sessions as a warning area, so decide your session-locking position before enabling it. Keep the profiler data collector out of production configuration and use it as a development-only tool.
Is snc/redis-bundle safe for long-running workers and production?
It can be, but long-running processes need deliberate tuning: persistent connection reuse (connection_persistent now accepts a connection id) should be configured rather than left to defaults, and a memory leak affecting FrankenPHP worker mode was only fixed in 4.11.0. Client behavior is functionally identical by intent rather than guarantee, so timeout defaults and TLS handling can diverge between Predis and PhpRedis. Pin versions, test your exact worker runtime, and confirm which fixes landed in the release you deploy.
What are the alternatives to snc/redis-bundle?
For Laravel applications, Illuminate\Redis is the native replacement and covers connection management, configuration and events without any Symfony container. In Symfony, you can use symfony/cache's RedisAdapter or wire Predis and PhpRedis services directly if you do not need multi-client, Sentinel or sharding management. The bundle is also valuable as a reference for DSN parsing conventions and timeout, retry and Sentinel option mapping even when you choose not to depend on it.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections