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

Mongodb Migrations Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Sidecar CLI — run the Symfony bundle in an isolated container (or a dedicated 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.
  2. Extract the engine — depend on the underlying migrations library directly (Composer), write an 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).
  3. Fork and vendor — highest cost, highest control.

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:

  • Version drift. Symfony bundle era is likely 2.x/3.x/4.x. PHP 8.x and Symfony 6/7 compatibility is unverified and unlikely to have been maintained.
  • Legacy driver dependency. Migration bundles of this vintage frequently pin against the removed ext-mongo extension rather than ext-mongodb + mongodb/mongodb or alcaeus/mongo-php-adapter. This is a hard blocker on any modern runtime.
  • MongoDB server feature lag. Server 4.0/5.0/6.0/7.0 introduced transactional DDL semantics, index build changes, and $expr/aggregation-stage differences that older migration tooling does not model.
  • Abandonware. No dependents means no one is filing issues; expect silent breakage rather than bug reports.

Key questions for the spike.

  • What are the exact composer.json constraints — Symfony version, PHP version, and does it require ext-mongo?
  • Is the underlying graviton/mongodb-migrations engine independently instantiable without a Symfony container?
  • What license, and is there any commit activity in the last 24 months? Is the repo archived?
  • Does the engine support checksums/versioning (a migrations collection), or only blind up/down ordering?
  • Is there a distributed lock to prevent concurrent migration runs across multiple app pods?
  • Does it handle index creation on existing large collections, and does it support background/rolling index builds?
  • Rollback semantics: is down() guaranteed, and what happens on a partially applied migration?
  • Is there any transaction boundary, and does it require a replica set?
  • Who internally would own a fork if path 3 is chosen?

Integration Approach

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:

  1. Spike (1 sprint). Stand up a throwaway Laravel + 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.
  2. Decide: extract vs. sidecar. Choose extract if the engine instantiates cleanly; choose sidecar only if the engine is tightly container-bound and the team already runs a PHP-Symfony service.
  3. Wrap, don't fork. Build 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.
  4. Fallback plan. If both fail, adopt a purpose-built alternative before writing a bespoke framework. Viable substitutes: 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).

Operational Impact

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.

  • Partially applied migration with no rollback → manual repair against production data.
  • Migration collection drift between environments (dev applied manually, prod unversioned) → silent schema divergence.
  • Concurrent execution during horizontal scaling → duplicate index creation errors, blocked deploys.
  • Legacy driver incompatibility surfacing only at runtime → deploy-time crash, not build-time.
  • Long index build holding a lock → extended deploy stall and possible rollback storm.
  • Dual ODM/Eloquent mapping disagreement on field types (BSON date vs. string) → read-path corruption that migrations cannot detect.

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.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource