graviton/mongodb-migrations-bundle
A Laravel bundle that adds MongoDB-aware migration support, letting you version, run, and roll back database changes through familiar artisan-style workflows. Simplifies schema and index management for MongoDB-backed apps while keeping migrations organized and repeatable.
Architecture fit. Poor. graviton/mongodb-migrations-bundle is a Symfony bundle — its value is almost entirely in Symfony DI wiring (service definitions, compiler passes, bundle registration in AppKernel/bundles.php, console command registration). Laravel has no bundle concept; the integration surface is a service provider + Artisan command. The only reusable asset is the underlying migration engine (the thing that discovers, orders, applies, and versions migration classes against MongoDB), and that layer is a separate graviton/mongodb-migrations library that the bundle wraps. Evaluating the bundle for a Laravel codebase is therefore really evaluating a dependency we would strip out and re-host.
Integration feasibility. Low-to-moderate, and conditional. There are three viable paths:
bin/console image) purely as a migration runner against shared MongoDB. Least code, but introduces a second framework runtime, a second config source of truth, and a second CI/CD pipeline to maintain.artisan mongo:migrate command with a local config file. Cleanest long-term, but requires an internal spike to confirm the engine has no Symfony coupling leaks (container-bound factories, kernel.event_dispatcher, PSR-11 assumptions).Also note a data-access mismatch: this tooling is built around Doctrine MongoDB ODM (Documents/Hydrators), while a Laravel codebase typically uses mongodb/laravel-mongodb with Eloquent models. Running both ODM and Eloquent against the same collections is possible but means two mapping conventions, two hydration behaviors, and two sets of index/validation assumptions in one database.
Technical risk. High. The metrics are the headline: zero stars, zero dependents, a score of 0. This is a single-vendor (LibreGraviton) artifact with no visible community, no third-party usage, and no ecosystem pressure to keep it current. Specific risks:
ext-mongo extension rather than ext-mongodb + mongodb/mongodb or alcaeus/mongo-php-adapter. This is a hard blocker on any modern runtime.$expr/aggregation-stage differences that older migration tooling does not model.Key questions for the spike.
composer.json constraints — Symfony version, PHP version, and does it require ext-mongo?graviton/mongodb-migrations engine independently instantiable without a Symfony container?migrations collection), or only blind up/down ordering?background/rolling index builds?down() guaranteed, and what happens on a partially applied migration?Stack fit. Weak as-is, adequate after extraction. A Laravel service provider wrapping the underlying migration engine is a genuinely useful capability — Laravel's native migrator is SQL-oriented and does not model MongoDB collection creation, JSON schema validators, or index management well, so teams routinely hand-roll this. The bundle itself contributes nothing to that effort.
Migration path. Recommended sequence:
mongodb/laravel-mongodb app, pull the underlying migrations library, and try to apply two migrations (a collection with a JSON schema validator, and a compound index) without Symfony. Timebox it; the answer is usually decided within days.artisan mongo:migrate and artisan mongo:migrate:status as thin adapters over the engine, with migration classes in database/migrations-mongo/ and a config entry mirroring config/database.php connection names.mongodb/laravel-mongodb's Schema builder for collection/index operations driven from a thin custom command, or antiMatter/mongodb-migrations (integrated with the generic migrations package), or a Doctrine ODM standalone migrations runner. Budget 2–3 sprints for a bespoke implementation — it is not a one-week task once ordering, checksums, locking, and status reporting are included.Compatibility. Must verify: PHP 8.1+, Laravel 10/11, ext-mongodb 1.15+, mongodb/mongodb 1.15+, MongoDB server 5.0+, and coexistence with mongodb/laravel-mongodb (Composer conflict check on the shared mongodb/mongodb and Doctrine persistence/mapping packages — dual ODM/Eloquent stacks frequently collide on Doctrine Common versions).
Sequencing. Do not make migration tooling a prerequisite for the application feature work. Land the migration runner in a dedicated PR, validate against a staging replica set, and only then migrate existing schema state into it (baseline the current collections as a no-op 000_baseline migration so up is idempotent on already-provisioned environments).
Maintenance. The primary cost is dependency ownership, not code volume. A zero-dependent package means we are de facto maintainers: every PHP, Symfony/Doctrine, or driver bump becomes our patch. If we extract the engine, we own that fork permanently — assign a named owner and a review cadence (quarterly dependency audit). If we sidecar it, we own a second runtime image and its CVE patching.
Support. There is no upstream support channel with meaningful throughput. Escalation path is: internal owner → upstream issue (expect no response) → local patch. Document this explicitly so it is not discovered during an incident.
Scaling. Migration execution is a deploy-time, single-writer concern. Confirm the engine serializes runs (a lock document or unique index on the migrations collection); without it, N replicas starting simultaneously will double-apply and produce nondeterministic failures — a classic container-orchestrator failure. Large-collection index builds must be non-blocking and must not run inside a rolling deploy window. For MongoDB, multi-document transactions require a replica set; migration tooling from this vintage likely assumes standalone and no atomicity.
Failure modes.
Ramp-up. Moderate for the extraction path: engineers need enough Doctrine ODM literacy to write correct Documents and understand hydration, plus familiarity with the migration engine's ordering/checksum model. Estimate one sprint of onboarding for a mid-level PHP engineer, and require a second reviewer on every migration PR. The sidecar path is cheaper to learn but adds infrastructure cognitive load to the platform team. Budget for a written runbook covering: how to add a migration, how to baseline a new environment, how to recover from a partial apply, and how to verify status in CI.
Recommendation. Treat this bundle as a reference implementation, not a dependency. It is not adoptable in a Laravel codebase at zero stars/zero dependents without a verified compatibility spike, and the bundle layer is dead weight regardless. Greenlight a timeboxed spike on extracting the underlying migration engine; default to a purpose-built Artisan migration runner over mongodb/laravel-mongodb if the spike fails.
How can I help you explore Laravel packages today?