Software Alternatives, Accelerators & Startups

Doctrine ORM VS JDBI

Compare Doctrine ORM VS JDBI and see what are their differences

Doctrine ORM logo Doctrine ORM

PHP object relational mapper (ORM) that sits on top of a powerful database abstraction layer (DBAL).

JDBI logo JDBI

See this.
  • Doctrine ORM Landing page
    Landing page //
    2022-04-20
  • JDBI Landing page
    Landing page //
    2023-08-02

Doctrine ORM features and specs

  • Database Abstraction
    Doctrine ORM provides a high level of abstraction over the database, enabling developers to work with objects and classes instead of SQL code directly. This abstraction allows for easier interaction with the database and improves code readability and maintainability.
  • Powerful Query Language
    Doctrine ORM includes DQL (Doctrine Query Language), which is similar to SQL but works with your application's object model. It provides a powerful way to query data efficiently and expressively using objects instead of raw SQL.
  • Advanced Features
    Features like automatic schema generation, entity life cycle events, and support for complex data types make Doctrine ORM a robust choice for developers needing advanced ORM capabilities.
  • Community and Documentation
    Doctrine ORM has a strong community and extensive documentation, which is beneficial for both novice and experienced developers looking to learn and troubleshoot issues.
  • Integration with Symfony
    Doctrine ORM integrates seamlessly with the Symfony PHP framework, making it a popular choice for developers using Symfony for their applications.

Possible disadvantages of Doctrine ORM

  • Learning Curve
    Due to its complexity and the depth of its features, Doctrine ORM can have a steep learning curve for developers unfamiliar with ORM concepts or those who are new to the framework.
  • Performance Overhead
    The abstraction layer and additional features of Doctrine ORM can introduce performance overhead compared to writing raw SQL, particularly in applications where high query performance is critical.
  • Complexity in Complex Queries
    While DQL offers many advantages, expressing complex queries can sometimes be cumbersome and may require developers to resort to native SQL, which can counteract some benefits of using an ORM.
  • Configuration Complexity
    Configuring Doctrine ORM can be complex and requires careful setup to ensure entities and relationships are correctly defined, which can be error-prone for large projects.

JDBI features and specs

  • Simplicity
    JDBI provides a simple, fluent API that makes accessing relational databases in Java more streamlined and less error-prone than using plain JDBC.
  • SQL-centric Approach
    JDBI allows developers to work directly with SQL, offering the flexibility to use any SQL feature without abstraction limitations.
  • Ease of Integration
    JDBI is easy to integrate into existing projects and works seamlessly with various database systems.
  • Declarative Mapping
    It supports declarative and annotation-based data mapping, reducing boilerplate code when converting between database rows and Java objects.
  • Extensibility
    JDBI's plugin architecture allows developers to extend its capabilities easily with custom features or integrate with other libraries.

Possible disadvantages of JDBI

  • Limited Abstraction
    Compared to full-fledged ORM frameworks, JDBI provides less abstraction, which could be a drawback for applications requiring complex entity relationships.
  • Manual Resource Management
    Developers need to manage database connections and resources, increasing the risk of resource leaks if not handled properly.
  • Less Mature than Some ORMs
    Although reliable, JDBI may not have the maturity or widespread adoption of some older ORMs, potentially resulting in less community support.
  • Learning Curve
    For developers used to traditional ORM frameworks, learning JDBI's idiomatic ways to achieve similar tasks might require an adjustment period.

Doctrine ORM videos

Create Doctrine ORM Entity and pagination in Expressive - 005

More videos:

  • Review - Marco Pivetta: Doctrine ORM Good Practices and Tricks
  • Review - Doctrine ORM

JDBI videos

jdbi

More videos:

  • Review - Dealing with a heckler | JDBI INVICTUS โ€˜19

Category Popularity

0-100% (relative to Doctrine ORM and JDBI)
Backend Development
33 33%
67% 67
Developer Tools
43 43%
57% 57
Web Frameworks
0 0%
100% 100
Databases
100 100%
0% 0

User comments

Share your experience with using Doctrine ORM and JDBI. For example, how are they different and which one is better?
Log in or Post with

Social recommendations and mentions

Based on our record, JDBI seems to be more popular. It has been mentiond 26 times since March 2021. We are tracking product recommendations and mentions on various public social media platforms and blogs. They can help you identify which product is more popular and what people think of it.

Doctrine ORM mentions (0)

We have not tracked any mentions of Doctrine ORM yet. Tracking of Doctrine ORM recommendations started around Mar 2021.

JDBI mentions (26)

  • Postgres pipelines from the JVM with Bpdbi
    Directly using the JDBC API in your application code is low-level and verbose. That's why libraries like Jdbi, Spring JDBC Template And Sql2o exist. They provide: named parameters, row mapping, pluggable data type binders/ row mappers/ JSON mappers. - Source: dev.to / 4 months ago
  • JOOQ Is Not a Replacement for Hibernate. They Solve Different Problems
    Suppose we're developing an application that allows speakers to submit their talks to a conference (for simplicity, we'll only record the talk's title). Following the Transaction Script pattern, the method for submitting a talk might look like this (using JDBI for SQL):. - Source: dev.to / over 1 year ago
  • Optimize Database Performance in Ruby on Rails and ActiveRecord
    _relational_ is the key word you're missing. ORMs map _objects_ to _relations_ (i.e. tables). "Unlike ORM frameworks, MyBatis does not map Java objects to database tables but Java methods to SQL statements." https://en.wikipedia.org/wiki/MyBatis "Jdbi is not an ORM. It is a convenience library to make Java database operations simpler and more pleasant to program than raw JDBC." https://jdbi.org/ "While jOOQ is not... - Source: Hacker News / over 1 year ago
  • Permazen: Language-natural persistence to KV stores
    While this may work for greenfield applications, I don't see this working well for preexisting schemas. From their getting started page: "Database fields are automatically created for any abstract getter methods", which definitely scares me away since they seem to be relying on automatic field type conversions. I prefer to manage my schemas when I can and do type and DAO conversions via mapper classes in the very... - Source: Hacker News / almost 3 years ago
  • Permazen: Language-natural persistence to KV stores
    Someone else mentioned jOOQ, but personally I also rather enjoyed JDBI3: https://jdbi.org/#_introduction_to_jdbi_3 It addresses the issues with using JDBC directly (not nice ergonomics), while still letting you work with SQL directly without too many abstractions in the middle. In combination with Dropwizard, it was pretty pleasant: https://www.dropwizard.io/en/stable/manual/jdbi3.html Other than that, I actually... - Source: Hacker News / almost 3 years ago
View more

What are some alternatives?

When comparing Doctrine ORM and JDBI, you can also consider the following products

Nette - Home Page. Let's create the home page displaying your recent posts. Before we start, you should know at least some basics about Model-View-Presenter design pattern (similar to MVC ):. Model โ€“ data manipulation layer.

Javalin - Simple REST APIs for Java and Kotlin

Eloquent ORM - [READ ONLY] Subtree split of the Illuminate Database component (see laravel/framework) - illuminate/database

Micronaut Framework - Build modular easily testable microservice & serverless apps

Apache Solr - Solr is an open source enterprise search server based on Lucene search library, with XML/HTTP and...

Hibernate - Hibernate an open source Java persistence framework project.