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

Noorm Bundle Laravel Package

bisonlab/noorm-bundle

Symfony bundle for bisonlab/noorm that wires a lightweight, No-ORM data access layer into your app. Provides service configuration and integration so you can run queries and map results without a full ORM, keeping persistence simple and fast.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • NoORM Philosophy: The bundle aligns with projects avoiding traditional ORMs (e.g., Doctrine) for performance, flexibility, or simplicity. Ideal for:
    • High-performance read-heavy applications (e.g., analytics, reporting).
    • Projects requiring raw SQL control without full ORM overhead.
    • Microservices or APIs where query complexity is low but speed is critical.
  • Symfony Ecosystem: Seamlessly integrates with Symfony’s dependency injection, configuration, and event systems. Leverages Symfony’s existing database abstraction (e.g., Connection, Platform) under the hood.
  • Anti-Patterns: Misaligned with projects needing advanced ORM features (e.g., relationships, migrations, caching layers like Doctrine’s second-level cache).

Integration Feasibility

  • Low Friction: Designed as a drop-in bundle with minimal configuration (YAML/XML/annotation-based). No schema migrations or entity classes required.
  • Database Agnostic: Works with any PDO-supported database (MySQL, PostgreSQL, SQLite, etc.) via Symfony’s DatabaseConnection interface.
  • Query Builder Compatibility: Extends Symfony’s QueryBuilder for type-safe, fluent queries without ORM abstractions. Example:
    $users = $noOrm->select('users')->where(['active' => true])->fetchAll();
    
  • Limitations:
    • No built-in support for complex joins, subqueries, or stored procedures (requires raw SQL).
    • Lacks transaction management beyond Symfony’s EntityManager (must use Connection directly).

Technical Risk

  • Adoption Risk:
    • Team Familiarity: Developers accustomed to Doctrine may resist the shift to NoORM. Requires buy-in for simpler (but less feature-rich) patterns.
    • Tooling Gaps: Missing IDE support (e.g., autocompletion for tables/columns) compared to Doctrine’s metadata-driven tools.
  • Performance Risk:
    • N+1 Queries: No built-in lazy-loading or DQL optimizations; manual query batching required.
    • Memory Usage: Fetching large datasets as arrays (vs. Doctrine’s hydrators) may increase memory overhead.
  • Long-Term Risk:
    • Maintenance: Bundle has 0 dependents and 6 stars, suggesting low community activity. Risk of stagnation or breaking changes.
    • Symfony Version Lock: Check compatibility with your Symfony LTS version (e.g., Symfony 6.x may require updates).

Key Questions

  1. Why NoORM?
    • Are you optimizing for performance, avoiding Doctrine’s complexity, or targeting a specific use case (e.g., ETL, batch processing)?
    • Have you benchmarked NoORM vs. raw PDO or Doctrine for your workload?
  2. Team Readiness
    • Is the team comfortable with SQL-first development? Will you need to enforce query review processes?
    • How will you handle edge cases (e.g., SQL injection, dynamic queries) without ORM safeguards?
  3. Tooling & Workflow
    • How will you manage database schema changes (migrations)? NoORM doesn’t include a migration tool.
    • Will you integrate with existing tools (e.g., Doctrine Migrations, PHPStorm DB tools)?
  4. Scaling
    • How will you handle connection pooling, read replicas, or sharding without ORM abstractions?
    • Are you prepared to manage raw SQL for complex queries (e.g., multi-table joins)?
  5. Alternatives
    • Have you considered lighter alternatives like:
      • Doctrine DBAL (more features, higher learning curve).
      • Cycle ORM (performance-focused, but more complex).
      • Raw PDO (if you need absolute control).

Integration Approach

Stack Fit

  • Symfony Projects: Perfect fit for Symfony applications where Doctrine is overkill or undesirable. Works alongside existing Symfony services (e.g., ParameterBag, EventDispatcher).
  • PHP Versions: Compatible with PHP 8.0+ (check bundle’s composer.json for exact requirements).
  • Database Stack: Requires PDO drivers for your database (e.g., pdo_mysql, pdo_pgsql). No additional extensions needed.
  • Anti-Fit:
    • Non-Symfony projects (would require manual integration).
    • Projects using other ORMs (e.g., Eloquent, Cycle) without extraction layers.

Migration Path

  1. Assessment Phase:
    • Audit existing queries to identify ORM-dependent logic (e.g., relationships, hydration).
    • Map Doctrine entities to NoORM table/column references.
  2. Incremental Rollout:
    • Phase 1: Replace simple CRUD operations (e.g., findOneBy, findAll) with NoORM equivalents.
      // Before (Doctrine)
      $user = $entityManager->getRepository(User::class)->findOneBy(['email' => 'test@example.com']);
      
      // After (NoORM)
      $user = $noOrm->select('users')->where(['email' => 'test@example.com'])->fetchOne();
      
    • Phase 2: Migrate complex queries to raw SQL or NoORM’s QueryBuilder extension.
    • Phase 3: Deprecate Doctrine entities (if no longer needed) and update tests.
  3. Tooling Migration:
    • Replace Doctrine-specific tools (e.g., make:entity, make:migration) with:
      • Custom console commands for schema management.
      • SQL migration tools (e.g., Flyway, Liquibase).
    • Update CI/CD pipelines to remove Doctrine-related checks (e.g., schema validation).

Compatibility

  • Symfony Components:
    • Uses symfony/database for connections (compatible with Symfony 5.4+).
    • Integrates with symfony/dependency-injection for service configuration.
  • Third-Party Packages:
    • May conflict with packages expecting Doctrine (e.g., stof/doctrine-extensions). Audit dependencies.
    • Check for packages offering NoORM-specific extensions (e.g., query builders, hydrators).
  • Database-Specific Features:
    • NoORM abstracts database-specific SQL (e.g., LIMIT/OFFSET vs. FETCH FIRST). Test with your target DB.

Sequencing

  1. Pre-Migration:
    • Set up a parallel environment to test NoORM alongside Doctrine.
    • Containerize the bundle for isolated testing (e.g., Docker).
  2. Core Integration:
    • Start with non-critical modules (e.g., reporting, admin panels).
    • Gradually replace public APIs (e.g., controllers) that use Doctrine repositories.
  3. Post-Migration:
    • Remove Doctrine bundles (doctrine/orm, doctrine/doctrine-bundle) if unused.
    • Update documentation and onboarding materials to reflect NoORM patterns.
    • Implement query performance monitoring (e.g., XHProf) to catch regressions.

Operational Impact

Maintenance

  • Pros:
    • Simplified Codebase: No entity classes or XML/YAML mappings to maintain.
    • Direct SQL Control: Easier to debug queries and optimize performance.
    • Reduced Abstraction: Fewer layers between code and database (faster iteration).
  • Cons:
    • Manual Schema Management: No built-in migrations or schema validation. Requires discipline (e.g., SQL scripts, Flyway).
    • Query Maintenance: Complex queries must be manually updated if the schema changes.
    • Testing Overhead: More responsibility on developers to write and maintain integration tests for SQL logic.

Support

  • Developer Onboarding:
    • Steeper Learning Curve: Developers must understand SQL, query planning, and database internals.
    • Tooling Gaps: Lack of IDE support (e.g., no autocompletion for table/column names) may slow development.
  • Troubleshooting:
    • Debugging Complexity: Harder to trace issues in raw SQL vs. ORM exceptions (e.g., "Unknown column" errors).
    • Performance Issues: Requires manual query analysis (e.g., EXPLAIN plans) vs. Doctrine’s profiling tools.
  • Community Support:
    • Limited by bundle’s low adoption (6 stars, 0 dependents). Issues may go unanswered.
    • Relies on Symfony’s community for underlying database components.

Scaling

  • Performance:
    • Strengths:
      • Lower memory usage (no hydration objects).
      • Faster for simple queries (avoids ORM overhead).
    • Weaknesses:
      • No built-in caching (e.g., second-level cache). Must implement manually (e.g., Redis, OPcache).
      • Scaling reads requires manual sharding/replication strategies (NoORM doesn’t abstract this).
  • Concurrency:
    • Connection Handling: Must manage connection pooling manually (Symfony’s Connection handles this, but tuning is manual).
    • Locking: No ORM-level transaction management (use Connection->beginTransaction() directly).
  • Horizontal Scaling:
    • Works well with stateless architectures (e.g., API gateways) but requires careful design for shared state (e.g., distributed transactions).

Failure Modes

| Failure Type | Risk | Mitigation | |---------------------------|--------------------------------

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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours