phillarmonic/allegro-redis-odm-bundle
A Symfony bundle that integrates Allegro Redis ODM, providing configuration, service wiring, and dependency injection for Redis-backed object mapping. Persist and query PHP objects in Redis with minimal setup.
Read this first: the framework mismatch. phillarmonic/allegro-redis-odm-bundle is a Symfony bundle, not a Laravel package. There is no service provider, no config/*.php publish tag, no facade. If you are working in a Laravel codebase, this is not the dependency you install — you would reach for a Laravel-native Redis document mapper or just use Illuminate\Support\Facades\Redis with your own serialization. This assessment is therefore written from the perspective of a Laravel developer who has to evaluate, integrate, or maintain a Symfony service (or a mixed/legacy stack) where this bundle is the candidate.
Minimal steps once you've confirmed the framework fit:
composer require phillarmonic/allegro-redis-odm-bundle and check composer.json in the repo for the supported PHP and Symfony version range before installing — this is the single highest-risk constraint.config/bundles.php.config/packages/<bundle_alias>.yaml with your Redis DSN/connection and mapping paths. Open DependencyInjection/Configuration.php in the repo to get the real config tree — it is the authoritative documentation, not the README..env (REDIS_URL=redis://...) and reference it in the YAML.docker run -p 6379:6379 redis:7-alpine).Where to look first, in order: composer.json (version constraints) → DependencyInjection/Configuration.php (config surface) → DependencyInjection/*Extension.php (what services are actually registered and their IDs) → Resources/config/*.xml|yaml (service definitions and aliases) → the ODM package it wraps, since the bundle is thin and the real API lives there.
First use case that justifies the bundle: a Redis-backed store for high-write, low-query data — session/activity records, analytics counters, ephemeral job payloads, cached API response snapshots — where you want typed document objects and repositories rather than raw hset/json.set calls scattered through services. If your data is relational, needs joins, or needs multi-document transactions, stop here.
Prefer injected repositories over the document manager. The bundle's value is autowiring; use it. Inject a specific repository into the service that owns that aggregate rather than injecting a global DocumentManager and calling getRepository() everywhere — the latter recreates the service-locator problem you adopted a DI container to avoid. Use the manager only at boundaries where the document type is genuinely dynamic.
Wrap the package behind one of your own interfaces. With 5 stars and a single maintainer, this is not a package to let leak into 40 files. Define App\Persistence\DocumentStoreInterface and implement it with the ODM manager. That interface is your escape hatch, your test seam, and the thing you rewrite if the bundle is abandoned.
Environment-specific configuration. Keep the connection block identical across config/packages/{dev,test,prod} and vary only the DSN and database index. Give each environment (and each parallel test worker) a distinct Redis logical DB or key prefix — see gotchas.
Testing pattern. Use a dedicated Redis database (e.g. redis://localhost:6379/15) in config/packages/test/, flush it in setUp, and assert against documents rather than raw keys. Because there are no migrations and no schema, a dirty test keyspace produces failures that look like logic bugs. Prefer FLUSHDB on the test DB only, or namespace every key with the test's name and delete by prefix in tearDown.
Multiple connections / managers. If the bundle exposes more than one manager (verify in the extension class), use the pattern: one manager for volatile data with a TTL, one for durable documents. Do not mix TTL'd and permanent documents in the same repository — the "why did my record vanish" bug is always an inherited TTL from a key prefix collision.
Consistent key naming. Agree a convention up front — {env}:{domain}:{document}:{id} — and encode it in one place (a base document class or a key-building service), not in each document. Redis keyspace is the database; treat it like a schema you cannot migrate.
Integration points worth wiring: Symfony Messenger for persisting message payloads or dead-letter records; the Serializer for normalizing API responses into documents; a console command for periodic key auditing/cleanup (SCAN + TTL report) rather than ad-hoc redis-cli sessions.
If you are bridging into Laravel (mixed stack, shared Redis, data written by a Symfony service and read by a Laravel app): never share configuration. The Laravel side should talk to the same Redis keyspace through an explicit, versioned serialization contract you own, not by trying to instantiate Symfony services. Treat the document format as an API between the two applications.
assessment-pm.md in the repo reads like generic Laravel-ecosystem boilerplate (migrations, Blade/Inertia scaffolding, config publishing). None of that applies to this bundle. Discount that document almost entirely when making a technical decision; use composer.json and the DependencyInjection directory instead.composer.json, commit the lockfile, and record the bundle in your upgrade plan alongside your Symfony/PHP major upgrades. If the package stops tracking Symfony releases, you fork or replace — which is why the interface wrapper above is not optional.bin/console config:dump-reference <alias> and bin/console debug:container | grep -i redis to find the actual alias and the registered service IDs.redis-cli session nobody can reproduce.TTL <key> on a freshly persisted document during the spike.redis-cli MONITOR to see exactly what commands the ODM emits (invaluable for understanding what the manager actually does), SCAN 0 MATCH prefix:* COUNT 100 instead of KEYS * on anything shared, and bin/console debug:container <service_id> --show-arguments to confirm what was injected. Log the DSN host/db at boot in dev — pointing the test suite at production Redis is a classic.rediss://), ACL usernames, cluster mode, and selecting a logical database are the four things that most often silently differ between your local Redis and production. Confirm each is configurable through the bundle's config tree; if not, that's a fork.services.yaml is a two-line change and survives upgrades better than patching vendor code.How can I help you explore Laravel packages today?