experteam/api-redis-bundle
Symfony 5.1+ bundle providing Redis services for APIs: a Predis client wrapper for reading and writing, plus a transport to persist entities and dispatch message queues, configured via YAML with per-entity prefixes and serialization groups.
Architecture fit — primary blocker: the package is a Symfony bundle, not a Laravel package. It ships a Symfony Bundle class, a DependencyInjection extension, and a YAML config tree loaded from config/packages/. Laravel has no bundle/extension lifecycle; adopting this in a Laravel codebase requires either (a) porting the container wiring into a ServiceProvider + config/api_redis.php, or (b) ignoring the bundle and consuming only its underlying classes via Composer autoload. Neither is a drop-in integration. If the target application is genuinely Laravel, the architecture fit is poor and should be treated as "source of design ideas," not a dependency.
Scope delivered: two thin capabilities — a Predis client wrapper (read/write) and a "Redis Transport" that persists entities to Redis and dispatches messages to queues. Both are commodity concerns in either ecosystem (Illuminate\Redis, Illuminate\Queue, symfony/cache, symfony/messenger with the Redis transport). The package's only differentiated surface is convention: serialize_groups, per-entity prefix/save/message/message_class config, and an elk_logger toggle that logs save/message operations.
Integration feasibility: mechanically trivial (single composer require, one YAML file, an optional vendor_copy.php post-install script). Substantively risky: the config-copy-via-composer-script pattern mutates the host project's filesystem on every install/update and is a well-known source of CI drift and merge conflicts.
Technical risk — high:
Key questions before any commitment:
serialize_groups reuse Symfony Serializer groups? If so, what prevents over-exposure of entity fields into Redis payloads?message_class mappings resolved — container, reflection, or string convention? What is the failure mode on a typo?elk_logger synchronous and blocking on the request path?Verdict: MIT license makes forking viable, but there is no compelling reason to adopt this over first-party primitives. Recommend no-go as a dependency; consider it a ~1–3 dev-day reference implementation if the team wants the entity-prefix + serialize-group convention internally.
Stack fit:
Illuminate\Support\Facades\Redis for read/write, Illuminate\Queue\RedisQueue (optionally Horizon) for dispatch, and Laravel's config/*.php + a ServiceProvider if the entity-prefix convention is genuinely wanted. Net new code is small and fully under team ownership.config/packages/ manually (skip the vendor_copy.php post-install script), and add a contract test around the client and transport.Migration path (Symfony):
composer why-not.Acme\RedisTransport) under MIT — strip the vendor_copy.php script, replace the YAML example with a checked-in config, add PHPUnit coverage for save/message paths.app/Support/Redis/ with a RedisTransportServiceProvider.Compatibility checks to run before writing code:
composer.json require block: Symfony version range, Predis version range, PHP floor. Any of these alone can veto the integration on a modern app.TreeBuilder, autowiring aliases).Sequencing:
save: false, message: true to exercise only the queue path.save writes.Compatibility note: serialize_groups binds the persistence schema to serializer groups, so entity changes become Redis-schema changes. Any rollout must include a key-prefix/versioning convention (e.g., prefix includes a schema version) before the first production write, because there is no documented migration tooling.
Maintenance: the dominant cost is not the code — it is the absence of an upstream. Expect to own the fork outright: Predis major upgrades, Symfony major upgrades, and PHP minor bumps all become internal work. Budget roughly 2–4 days/year of stewardship for a package this small, plus the risk of a Redis-format migration if the serializer contract changes. MIT + small surface makes this tractable; it does not make it free.
Support: no vendor SLA, no issue traffic, no community to search when something breaks. On-call runbooks must be written internally from scratch. Compare against symfony/messenger or Laravel queues, where failure modes are documented and widely encountered.
Scaling:
elk_logger toggles sit on the save and message paths. If they are synchronous, they add latency and a second failure domain to every write. Verify they are fire-and-forget or sampled.Failure modes to instrument before the pilot:
save fail open (degrade to DB) or fail the request? Undefined in the README — must be decided explicitly.SET vs multi-command).message_class is string-resolved; a typo likely surfaces only at dispatch time, on the queue worker, not at boot. Add a container-compile or boot-time assertion.Ramp-up: the code surface is small, so a mid-level engineer can read it in an afternoon. The real ramp-up cost is institutional — the team must reconstruct the contracts the README omits (delivery semantics, failure behavior, scaling limits) through testing rather than documentation. Estimate 1–2 days of a senior engineer's time to produce an internal design note that a vendor would normally supply.
Overall recommendation: treat as a reference design, not a dependency. For a Laravel stack the answer is unambiguous — use first-party Redis and queue primitives. For a Symfony stack, a fork under MIT with added tests and explicit failure-mode decisions is defensible if the entity-prefix/serialize-group convention saves real application code; otherwise symfony/messenger + symfony/cache covers the same ground with a maintained upstream and a documented operational contract.
How can I help you explore Laravel packages today?