Comparison of Hibernate with Derby server vs OpenJPA with H2 embedded
Each of the following tables focuses on a specific database operation, where the last table presents average results comparison.
Speed comparison of JPA database persistence operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 3.8 | 17.1 | 3.0 | 5.8 | 3.4 | 11.5 |
Element Collection Test | 2.0 | 10.9 | 1.3 | 4.9 | 1.7 | 7.9 |
Inheritance Test | 3.4 | 14.3 | 3.0 | 5.9 | 3.2 | 10.1 |
Indexing Test | 4.8 | 24.4 | 4.1 | 13.7 | 4.4 | 19.1 |
Graph (Binary Tree) Test | 1.8 | 6.8 | 1.6 | 6.7 | 1.7 | 6.7 |
Multithreading Test | 6.9 | 34.2 | 3.9 | 10.2 | 5.4 | 22.2 |
All Tests | 3.8 | 17.9 | 2.8 | 7.9 | 3.3 | 12.9 |
The results above show that in general OpenJPA with H2 embedded is much more efficient than Hibernate with Derby server in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with Derby database server (3.3) to the normalized speed of OpenJPA with H2 embedded database (12.9) reveals that in these tests, OpenJPA with H2 embedded is 3.9 times faster than Hibernate with Derby server.
A large performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.0) to the normalized speed of OpenJPA with H2 embedded database (10.9) reveals that in that case, OpenJPA with H2 embedded is 5.4 times faster than Hibernate with Derby server.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 3.8 | 14.6 | 8.4 | 27.2 | 6.1 | 20.9 |
Element Collection Test | 1.0 | 0.0046 | 1.0 | 4.3 | 1.0 | 2.1 |
Inheritance Test | 3.5 | 0.011 | 9.7 | 7.4 | 6.6 | 3.7 |
Indexing Test | 3.2 | 17.0 | 9.5 | 35.0 | 6.4 | 26.0 |
Graph (Binary Tree) Test | 0.91 | 1.0 | 1.2 | 1.4 | 1.1 | 1.2 |
Multithreading Test | 7.8 | 18.7 | 13.4 | 27.6 | 10.6 | 23.1 |
All Tests | 3.4 | 8.6 | 7.2 | 17.1 | 5.3 | 12.8 |
The results above show that in general OpenJPA with H2 embedded is more efficient than Hibernate with Derby server in retrieving JPA entity objects from the database. Comparing the normalized speed of Hibernate with Derby database server (5.3) to the normalized speed of OpenJPA with H2 embedded database (12.8) reveals that in these tests, OpenJPA with H2 embedded is 2.4 times faster than Hibernate with Derby server.
A large performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby database server (3.2) to the normalized speed of OpenJPA with H2 embedded database (17.0) reveals that in that case, OpenJPA with H2 embedded is 5.3 times faster than Hibernate with Derby server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of Hibernate with Derby database server (3.5) reveals that in that case, OpenJPA with H2 embedded is 318 times slower than Hibernate with Derby server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 34.0 | 5.0 | 4.1 | 1.1 | 19.1 | 3.1 |
Element Collection Test | 33.8 | 1.7 | 0.64 | 1.3 | 17.2 | 1.5 |
Inheritance Test | 20.5 | 2.2 | 5.0 | 1.2 | 12.8 | 1.7 |
Indexing Test | 2.0 | 13.8 | 9.2 | 23.2 | 5.6 | 18.5 |
Multithreading Test | 36.2 | 1.4 | 5.1 | 0.60 | 20.6 | 0.99 |
All Tests | 25.3 | 4.8 | 4.8 | 5.5 | 15.1 | 5.1 |
The results above show that in general Hibernate with Derby server is more efficient than OpenJPA with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 embedded database (5.1) to the normalized speed of Hibernate with Derby database server (15.1) reveals that in these tests, Hibernate with Derby server is 3.0 times faster than OpenJPA with H2 embedded.
A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (1.4) to the normalized speed of Hibernate with Derby database server (36.2) reveals that in that case, Hibernate with Derby server is 25.9 times faster than OpenJPA with H2 embedded.
On the other hand, Hibernate with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby database server (2.0) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, Hibernate with Derby server is 6.9 times slower than OpenJPA with H2 embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 2.9 | 10.0 | 2.5 | 6.0 | 2.7 | 8.0 |
Element Collection Test | 2.3 | 0.011 | 1.5 | 3.8 | 1.9 | 1.9 |
Inheritance Test | 2.9 | 0.046 | 3.5 | 5.0 | 3.2 | 2.5 |
Indexing Test | 3.0 | 8.9 | 4.2 | 7.0 | 3.6 | 8.0 |
Graph (Binary Tree) Test | 1.2 | 2.4 | 0.58 | 1.3 | 0.91 | 1.9 |
Multithreading Test | 6.8 | 16.6 | 2.5 | 4.3 | 4.6 | 10.4 |
All Tests | 3.2 | 6.3 | 2.5 | 4.6 | 2.8 | 5.4 |
The results above show that in general OpenJPA with H2 embedded is more efficient than Hibernate with Derby server in updating JPA entity objects in the database.
A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.9) to the normalized speed of OpenJPA with H2 embedded database (10.0) reveals that in that case, OpenJPA with H2 embedded is 3.4 times faster than Hibernate with Derby server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of Hibernate with Derby database server (2.3) reveals that in that case, OpenJPA with H2 embedded is 209 times slower than Hibernate with Derby server.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 2.9 | 18.3 | 3.5 | 11.1 | 3.2 | 14.7 |
Element Collection Test | 1.7 | 0.012 | 0.87 | 2.9 | 1.3 | 1.4 |
Inheritance Test | 2.9 | 0.030 | 3.6 | 6.6 | 3.2 | 3.3 |
Indexing Test | 3.7 | 23.2 | 3.6 | 9.7 | 3.7 | 16.4 |
Graph (Binary Tree) Test | 0.69 | 1.8 | 0.70 | 2.4 | 0.70 | 2.1 |
Multithreading Test | 6.2 | 31.2 | 5.1 | 17.3 | 5.6 | 24.2 |
All Tests | 3.0 | 12.4 | 2.9 | 8.3 | 3.0 | 10.4 |
The results above show that in general OpenJPA with H2 embedded is much more efficient than Hibernate with Derby server in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with Derby database server (3.0) to the normalized speed of OpenJPA with H2 embedded database (10.4) reveals that in these tests, OpenJPA with H2 embedded is 3.5 times faster than Hibernate with Derby server.
A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.9) to the normalized speed of OpenJPA with H2 embedded database (18.3) reveals that in that case, OpenJPA with H2 embedded is 6.3 times faster than Hibernate with Derby server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.012) to the normalized speed of Hibernate with Derby database server (1.7) reveals that in that case, OpenJPA with H2 embedded is 142 times slower than Hibernate with Derby server.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded | Hibernate Derby server | OpenJPA H2 embedded |
Basic Person Test | 9.5 | 13.0 | 4.3 | 10.2 | 6.9 | 11.6 |
Element Collection Test | 8.2 | 2.5 | 1.1 | 3.4 | 4.6 | 3.0 |
Inheritance Test | 6.6 | 3.3 | 5.0 | 5.2 | 5.8 | 4.3 |
Indexing Test | 3.3 | 17.5 | 6.1 | 17.7 | 4.7 | 17.6 |
Graph (Binary Tree) Test | 1.2 | 3.0 | 1.0 | 3.0 | 1.1 | 3.0 |
Multithreading Test | 12.8 | 20.4 | 6.0 | 12.0 | 9.4 | 16.2 |
All Tests | 7.1 | 10.2 | 4.0 | 8.8 | 5.6 | 9.5 |
The results above show that in general OpenJPA with H2 embedded is more efficient than Hibernate with Derby server in performing JPA database operations.
A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of Hibernate with Derby database server (3.3) to the normalized speed of OpenJPA with H2 embedded database (17.5) reveals that in that case, OpenJPA with H2 embedded is 5.3 times faster than Hibernate with Derby server.
On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (2.5) to the normalized speed of Hibernate with Derby database server (8.2) reveals that in that case, OpenJPA with H2 embedded is 3.3 times slower than Hibernate with Derby server.
Other Head to Head DBMS/JPA Comparisons
Hibernate with Derby server against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- EclipseLink with PostgreSQL server
- Hibernate with Derby embedded
- Hibernate with H2 embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with H2 server
- Hibernate with MySQL server
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with H2 embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server
OpenJPA with H2 embedded against:
- Oracle Database 11g
- IBM DB2 10
- Microsoft SQL Server 2008
- DataNucleus with Derby embedded
- DataNucleus with H2 embedded
- DataNucleus with HSQLDB embedded
- DataNucleus with DB4O embedded
- DataNucleus with Derby server
- DataNucleus with H2 server
- DataNucleus with MySQL server
- DataNucleus with PostgreSQL server
- EclipseLink with Derby embedded
- EclipseLink with H2 embedded
- EclipseLink with HSQLDB embedded
- EclipseLink with SQLite embedded
- EclipseLink with Derby server
- EclipseLink with H2 server
- EclipseLink with MySQL server
- EclipseLink with PostgreSQL server
- Hibernate with Derby embedded
- Hibernate with H2 embedded
- Hibernate with HSQLDB embedded
- Hibernate with SQLite embedded
- Hibernate with Derby server
- Hibernate with H2 server
- Hibernate with MySQL server
- Hibernate with PostgreSQL server
- OpenJPA with Derby embedded
- OpenJPA with HSQLDB embedded
- OpenJPA with Derby server
- OpenJPA with H2 server
- OpenJPA with MySQL server
- OpenJPA with PostgreSQL server
- ObjectDB embedded
- ObjectDB server