Weave Code
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

Doctrine Json Odm Laravel Package

dunglas/doctrine-json-odm

Doctrine JSON ODM maps JSON documents to PHP objects using Doctrine-style metadata, enabling persistence and querying of JSON data through a familiar ORM-like API. Useful for working with JSON stored in files or other backends while keeping domain models clean.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Expansion for JSON Data Handling:

    • Enables PostgreSQL jsonb optimization via the new jsonb_document type (DBAL 4.3.0+), improving performance for JSON-heavy workloads (e.g., analytics, nested configurations).
    • Supports Symfony 8 compatibility, aligning with modern PHP ecosystems and reducing friction for new projects or upgrades.
    • Strengthens use cases for hybrid relational/document workflows (e.g., storing JSON metadata alongside relational data in Doctrine entities) without schema migrations.
  • Roadmap for Flexible Data Models:

    • Accelerates adoption of schema-less data for dynamic features (e.g., feature flags, user preferences) while leveraging native database optimizations (e.g., jsonb indexing).
    • Reduces technical debt for legacy modernization by enabling JSON columns in existing PostgreSQL/MySQL databases without NoSQL overhead.
  • Build vs. Buy:

    • Avoids reinventing JSON document mapping while future-proofing with DBAL 4.3.0+ and Symfony 8 support, ensuring long-term compatibility with Doctrine’s ecosystem.
    • Lowers barriers for teams using Symfony 8 or newer Doctrine DBAL versions, as the package now natively integrates with these stacks.
  • Use Cases (updated):

    • Performance-critical JSON storage: Leverage jsonb_document for indexed, fast queries on nested data (e.g., filtering user->preferences->theme in PostgreSQL).
    • Symfony 8 migrations: Seamlessly integrate JSON data handling into greenfield or upgraded Symfony projects.
    • Analytics/auditing: Store and query complex event payloads (e.g., API responses) with native JSON support.
    • Configuration management: Dynamic feature flags or A/B test variants stored as JSON without schema migrations.

When to Consider This Package

Adopt if:

  • Your app uses Doctrine ORM and needs nested, semi-structured JSON data in PostgreSQL (jsonb) or MySQL (JSON).
  • You’re on DBAL 4.3.0+ (or can upgrade) and want to use the new jsonb_document type for optimized PostgreSQL jsonb storage.
  • You’re using Symfony 8 or planning to upgrade, as this release ensures compatibility.
  • Your team prefers PHP/Doctrine over NoSQL for consistency, and you need query flexibility (e.g., filtering JSON fields with Doctrine DQL).
  • You’re modernizing legacy systems with existing JSON columns and want to avoid vendor lock-in to MongoDB.

Look elsewhere if:

  • You require full document database features (e.g., sharding, advanced aggregations) → Use MongoDB or similar.
  • Your schema is strictly relational with no JSON needs → Stick with standard Doctrine entities.
  • You’re using SQLite, older MySQL (<5.7), or DBAL <4.3.0 (unless you can upgrade).
  • Your team lacks Doctrine ORM experience (steep learning curve for JSON mapping annotations).
  • You need real-time analytics or high-frequency writes where JSON indexing may not suffice (consider dedicated tools like Elasticsearch).

How to Pitch It (Stakeholders)

For Executives: "This updated package (v1.5.0) lets us store and query complex JSON data—like user settings or API payloads—directly in PostgreSQL/MySQL without switching to a NoSQL system. The new jsonb_document type optimizes performance for PostgreSQL, while Symfony 8 support ensures we’re future-proof. It’s a cost-effective way to modernize data models for dynamic features (e.g., feature flags, analytics) while keeping our stack simple and scalable. Think of it as ‘SQL’s answer to MongoDB flexibility’—with better query tools and lower operational overhead."

For Engineering: *"With v1.5.0, we can now:

  • Leverage PostgreSQL jsonb optimizations via jsonb_document (DBAL 4.3.0+), enabling indexed queries on nested JSON (e.g., WHERE user.data->>'role' = 'admin').
  • Seamlessly integrate with Symfony 8, reducing upgrade friction for new projects or migrations.
  • Avoid NoSQL complexity while gaining schema-free flexibility for use cases like:
    • Storing dynamic configurations (e.g., feature_flags as JSON).
    • Auditing API payloads with fast JSON lookups.
    • Hybrid relational/document workflows (e.g., user profiles + metadata). Tradeoffs: Minor learning curve for JSON mapping annotations, but the package now aligns with modern Doctrine/Symfony stacks. Ideal if you’re on DBAL 4.3.0+ or planning a Symfony 8 upgrade."*
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky