Compare with

Comparison of DataNucleus with H2 server vs Hibernate 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 EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test3.47.12.23.42.85.2
Element Collection Test1.22.90.641.70.922.3
Inheritance Test3.07.01.93.62.45.3
Indexing Test5.39.33.56.14.47.7
Graph (Binary Tree) Test2.13.01.32.91.72.9
Multithreading Test10.031.74.313.97.222.8
All Tests4.210.22.35.33.27.7

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with H2 server in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with H2 database server (3.2) to the normalized speed of Hibernate with PostgreSQL database server (7.7) reveals that in these tests, Hibernate with PostgreSQL server is 2.4 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (4.3) to the normalized speed of Hibernate with PostgreSQL database server (13.9) reveals that in that case, Hibernate with PostgreSQL server is 3.2 times faster than DataNucleus with H2 server.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test2.55.55.211.53.98.5
Element Collection Test0.560.0251.10.0170.820.021
Inheritance Test2.25.26.114.04.29.6
Indexing Test2.14.67.713.34.98.9
Graph (Binary Tree) Test5.70.618.90.787.30.70
Multithreading Test2.311.38.717.05.514.2
All Tests2.54.56.39.44.47.0

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with H2 server in retrieving JPA entity objects from the database.

A large performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (2.3) to the normalized speed of Hibernate with PostgreSQL database server (11.3) reveals that in that case, Hibernate with PostgreSQL server is 4.9 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.017) to the normalized speed of DataNucleus with H2 database server (1.1) reveals that in that case, Hibernate with PostgreSQL server is 64.7 times slower than DataNucleus with H2 server.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test4.155.51.36.12.730.8
Element Collection Test4.011.00.490.0162.35.5
Inheritance Test2.952.31.58.72.230.5
Indexing Test0.00360.0501.58.80.754.4
Multithreading Test1.355.2failed9.21.332.2
All Tests2.534.81.26.61.920.7

DataNucleus with H2 server has failed in 1 tests (see exceptions).

The results above show that in general Hibernate with PostgreSQL server is much more efficient than DataNucleus with H2 server in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 database server (1.9) to the normalized speed of Hibernate with PostgreSQL database server (20.7) reveals that in these tests, Hibernate with PostgreSQL server is 10.9 times faster than DataNucleus with H2 server.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (1.3) to the normalized speed of Hibernate with PostgreSQL database server (55.2) reveals that in that case, Hibernate with PostgreSQL server is 42.5 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.016) to the normalized speed of DataNucleus with H2 database server (0.49) reveals that in that case, Hibernate with PostgreSQL server is 30.6 times slower than DataNucleus with H2 server.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test2.55.31.42.71.94.0
Element Collection Test2.00.0671.00.0261.50.046
Inheritance Test2.45.42.33.82.34.6
Indexing Test2.75.43.04.32.94.8
Graph (Binary Tree) Test1.81.10.600.581.20.82
Multithreading Testfailed29.6failed6.3failed18.0
All Tests2.37.81.72.92.05.4

DataNucleus with H2 server has failed in 2 tests (see exceptions).

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with H2 server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with H2 database server (2.0) to the normalized speed of Hibernate with PostgreSQL database server (5.4) reveals that in these tests, Hibernate with PostgreSQL server is 2.7 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of DataNucleus with H2 database server (2.4) to the normalized speed of Hibernate with PostgreSQL database server (5.4) reveals that in that case, Hibernate with PostgreSQL server is 2.3 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.026) to the normalized speed of DataNucleus with H2 database server (1.0) reveals that in that case, Hibernate with PostgreSQL server is 38.5 times slower than DataNucleus with H2 server.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test3.45.31.34.22.34.8
Element Collection Test1.50.0200.68stopped1.10.0098
Inheritance Test2.75.11.34.22.04.6
Indexing Test5.79.51.96.33.87.9
Graph (Binary Tree) Test1.50.0121.20.0121.30.012
Multithreading Testfailed23.35.121.85.122.5
All Tests3.07.21.96.12.46.6

DataNucleus with H2 server has failed in 1 tests (see exceptions).

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with H2 server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with H2 database server (2.4) to the normalized speed of Hibernate with PostgreSQL database server (6.6) reveals that in these tests, Hibernate with PostgreSQL server is 2.8 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (5.1) to the normalized speed of Hibernate with PostgreSQL database server (21.8) reveals that in that case, Hibernate with PostgreSQL server is 4.3 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.012) to the normalized speed of DataNucleus with H2 database server (1.5) reveals that in that case, Hibernate with PostgreSQL server is 125 times slower than DataNucleus with H2 server.

Comparison of JPA/Database speed - the averages (normalized score, higher is better)

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
DataNucleus
H2 server
Hibernate
PostgreSQL server
Basic Person Test3.215.72.35.62.710.7
Element Collection Test1.92.80.780.351.31.6
Inheritance Test2.615.02.66.92.610.9
Indexing Test3.25.83.57.83.36.8
Graph (Binary Tree) Test2.81.23.01.12.91.1
Multithreading Test4.530.26.013.65.321.9
All Tests2.912.12.86.02.99.1

The results above show that in general Hibernate with PostgreSQL server is much more efficient than DataNucleus with H2 server in performing JPA database operations. Comparing the normalized speed of DataNucleus with H2 database server (2.9) to the normalized speed of Hibernate with PostgreSQL database server (9.1) reveals that in these tests, Hibernate with PostgreSQL server is 3.1 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (4.5) to the normalized speed of Hibernate with PostgreSQL database server (30.2) reveals that in that case, Hibernate with PostgreSQL server is 6.7 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (1.1) to the normalized speed of DataNucleus with H2 database server (3.0) reveals that in that case, Hibernate with PostgreSQL server is 2.7 times slower than DataNucleus with H2 server.

Other Head to Head DBMS/JPA Comparisons