Comparison of Hibernate with H2 embedded vs DataNucleus with PostgreSQL server
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 H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 18.1 | 4.1 | 9.0 | 2.6 | 13.5 | 3.3 |
Element Collection Test | 13.0 | 0.91 | 6.8 | 0.38 | 9.9 | 0.64 |
Inheritance Test | 21.0 | 3.8 | 9.4 | 2.4 | 15.2 | 3.1 |
Indexing Test | 29.9 | 6.0 | 18.4 | 6.4 | 24.1 | 6.2 |
Graph (Binary Tree) Test | 17.2 | 0.91 | 20.1 | 0.77 | 18.7 | 0.84 |
Multithreading Test | 36.9 | 18.0 | 11.5 | 8.3 | 24.2 | 13.1 |
All Tests | 22.6 | 5.6 | 12.5 | 3.5 | 17.6 | 4.5 |
The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with PostgreSQL server in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (4.5) to the normalized speed of Hibernate with H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 3.9 times faster than DataNucleus with PostgreSQL server.
A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.77) to the normalized speed of Hibernate with H2 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 26.1 times faster than DataNucleus with PostgreSQL server.
Speed comparison of JPA database retrieval operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 16.6 | 1.7 | 13.3 | 7.6 | 15.0 | 4.6 |
Element Collection Test | 4.3 | 0.73 | 4.0 | 0.63 | 4.1 | 0.68 |
Inheritance Test | 10.4 | 1.5 | 17.5 | 9.3 | 13.9 | 5.4 |
Indexing Test | 10.8 | 1.5 | 15.2 | 9.2 | 13.0 | 5.3 |
Graph (Binary Tree) Test | 2.5 | 2.6 | 4.0 | 12.3 | 3.3 | 7.4 |
Multithreading Test | 16.2 | 3.4 | 15.7 | 10.8 | 15.9 | 7.1 |
All Tests | 10.1 | 1.9 | 11.6 | 8.3 | 10.9 | 5.1 |
The results above show that in general Hibernate with H2 embedded is more efficient than DataNucleus with PostgreSQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (5.1) to the normalized speed of Hibernate with H2 embedded database (10.9) reveals that in these tests, Hibernate with H2 embedded is 2.1 times faster than DataNucleus with PostgreSQL server.
A large performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.7) to the normalized speed of Hibernate with H2 embedded database (16.6) reveals that in that case, Hibernate with H2 embedded is 9.8 times faster than DataNucleus with PostgreSQL server.
On the other hand, Hibernate with H2 embedded is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (4.0) to the normalized speed of DataNucleus with PostgreSQL database server (12.3) reveals that in that case, Hibernate with H2 embedded is 3.1 times slower than DataNucleus with PostgreSQL server.
Speed comparison of JPA database query operations (normalized score, higher is better)
Retrieval Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 4.5 | 49.1 | 1.2 | 4.7 | 2.8 | 26.9 |
Element Collection Test | 4.4 | 39.1 | 1.4 | 0.48 | 2.9 | 19.8 |
Inheritance Test | 3.1 | 55.9 | 1.5 | 6.6 | 2.3 | 31.2 |
Indexing Test | 6.6 | 0.048 | 10.5 | 6.4 | 8.6 | 3.2 |
Multithreading Test | 1.2 | failed | 0.59 | failed | 0.89 | failed |
All Tests | 4.0 | 36.0 | 3.0 | 4.5 | 3.5 | 20.3 |
DataNucleus with PostgreSQL server has failed in 2 tests (see exceptions).
The results above show that in general DataNucleus with PostgreSQL server is much more efficient than Hibernate with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 embedded database (3.5) to the normalized speed of DataNucleus with PostgreSQL database server (20.3) reveals that in these tests, DataNucleus with PostgreSQL server is 5.8 times faster than Hibernate with H2 embedded.
A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (3.1) to the normalized speed of DataNucleus with PostgreSQL database server (55.9) reveals that in that case, DataNucleus with PostgreSQL server is 18.0 times faster than Hibernate with H2 embedded.
On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.048) to the normalized speed of Hibernate with H2 embedded database (6.6) reveals that in that case, DataNucleus with PostgreSQL server is 138 times slower than Hibernate with H2 embedded.
Speed comparison of JPA database update operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 12.1 | 2.1 | 6.5 | 0.84 | 9.3 | 1.5 |
Element Collection Test | 7.4 | 1.4 | 5.3 | 0.64 | 6.3 | 1.0 |
Inheritance Test | 10.8 | 2.1 | 8.5 | 1.2 | 9.6 | 1.7 |
Indexing Test | 10.0 | 2.2 | 7.5 | 1.5 | 8.8 | 1.8 |
Graph (Binary Tree) Test | 4.4 | 0.65 | 2.3 | 0.20 | 3.4 | 0.42 |
Multithreading Test | 16.2 | 0.46 | 4.0 | failed | 10.1 | 0.46 |
All Tests | 10.1 | 1.5 | 5.7 | 0.87 | 7.9 | 1.2 |
DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).
The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with PostgreSQL server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.2) to the normalized speed of Hibernate with H2 embedded database (7.9) reveals that in these tests, Hibernate with H2 embedded is 6.6 times faster than DataNucleus with PostgreSQL server.
A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.46) to the normalized speed of Hibernate with H2 embedded database (16.2) reveals that in that case, Hibernate with H2 embedded is 35.2 times faster than DataNucleus with PostgreSQL server.
Speed comparison of JPA database removal operations (normalized score, higher is better)
Transaction Size => | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 19.7 | 3.0 | 11.4 | 1.3 | 15.5 | 2.2 |
Element Collection Test | 6.9 | 1.0 | 4.5 | 0.39 | 5.7 | 0.69 |
Inheritance Test | 15.6 | 2.8 | 12.9 | 1.3 | 14.2 | 2.1 |
Indexing Test | 23.2 | 5.4 | 12.4 | 1.9 | 17.8 | 3.7 |
Graph (Binary Tree) Test | 4.0 | 0.38 | 4.2 | 0.37 | 4.1 | 0.37 |
Multithreading Test | 27.4 | 13.8 | 22.7 | failed | 25.0 | 13.8 |
All Tests | 16.1 | 4.4 | 11.4 | 1.1 | 13.7 | 2.9 |
DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).
The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with PostgreSQL server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (2.9) to the normalized speed of Hibernate with H2 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 4.7 times faster than DataNucleus with PostgreSQL server.
A huge performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.39) to the normalized speed of Hibernate with H2 embedded database (4.5) reveals that in that case, Hibernate with H2 embedded is 11.5 times faster than DataNucleus with PostgreSQL server.
Comparison of JPA/Database speed - the averages (normalized score, higher is better)
Transaction/Retrieval Size | Few Entities | Many Entities | Average Score | |||
---|---|---|---|---|---|---|
  | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server | Hibernate H2 embedded | DataNucleus PostgreSQL server |
Basic Person Test | 14.2 | 12.0 | 8.3 | 3.4 | 11.2 | 7.7 |
Element Collection Test | 7.2 | 8.6 | 4.4 | 0.50 | 5.8 | 4.6 |
Inheritance Test | 12.2 | 13.2 | 9.9 | 4.2 | 11.0 | 8.7 |
Indexing Test | 16.1 | 3.0 | 12.8 | 5.1 | 14.5 | 4.0 |
Graph (Binary Tree) Test | 7.0 | 1.1 | 7.7 | 3.4 | 7.3 | 2.3 |
Multithreading Test | 19.6 | 8.9 | 10.9 | 9.5 | 15.2 | 9.1 |
All Tests | 12.9 | 8.0 | 9.0 | 3.8 | 11.0 | 6.0 |
The results above show that in general Hibernate with H2 embedded is more efficient than DataNucleus with PostgreSQL server in performing JPA database operations.
A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.50) to the normalized speed of Hibernate with H2 embedded database (4.4) reveals that in that case, Hibernate with H2 embedded is 8.8 times faster than DataNucleus with PostgreSQL server.
Other Head to Head DBMS/JPA Comparisons
Hibernate 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 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 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
DataNucleus with PostgreSQL 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
- 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 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