Compare with

Comparison of DataNucleus with MySQL server vs Hibernate 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 EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test2.618.11.49.02.013.5
Element Collection Test1.013.00.486.80.769.9
Inheritance Test2.521.01.39.41.915.2
Indexing Test4.029.92.518.43.324.1
Graph (Binary Tree) Test1.117.20.9920.11.118.7
Multithreading Test6.236.92.511.54.424.2
All Tests2.922.61.512.52.217.6

The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with MySQL server in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with MySQL database server (2.2) to the normalized speed of Hibernate with H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 8.0 times faster than DataNucleus with MySQL server.

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.99) to the normalized speed of Hibernate with H2 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 20.3 times faster than DataNucleus with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test0.9616.69.313.35.115.0
Element Collection Test0.184.30.774.00.474.1
Inheritance Test0.5510.48.517.54.513.9
Indexing Test0.8210.89.715.25.313.0
Graph (Binary Tree) Test2.12.53.54.02.83.3
Multithreading Test0.2716.27.815.74.015.9
All Tests0.8110.16.611.63.710.9

The results above show that in general Hibernate with H2 embedded is more efficient than DataNucleus with MySQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with MySQL database server (3.7) to the normalized speed of Hibernate with H2 embedded database (10.9) reveals that in these tests, Hibernate with H2 embedded is 2.9 times faster than DataNucleus with MySQL server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test7.24.52.21.24.72.8
Element Collection Test5.84.40.271.43.12.9
Inheritance Test2.93.11.71.52.32.3
Indexing Test0.00846.62.510.51.28.6
Multithreading Testfailed1.2failed0.59failed0.89
All Tests4.04.01.73.02.83.5

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

The results above show that in general Hibernate with H2 embedded is slightly more efficient than DataNucleus with MySQL server in executing the tested JPA queries.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with MySQL database server (0.0084) to the normalized speed of Hibernate with H2 embedded database (6.6) reveals that in that case, Hibernate with H2 embedded is 786 times faster than DataNucleus with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test0.6112.11.16.50.889.3
Element Collection Test0.317.40.445.30.386.3
Inheritance Test0.5110.81.88.51.19.6
Indexing Test0.6810.02.27.51.58.8
Graph (Binary Tree) Test0.914.40.472.30.693.4
Multithreading Test0.6416.2failed4.00.6410.1
All Tests0.6110.11.25.70.887.9

DataNucleus with MySQL 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 MySQL server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with MySQL database server (0.88) to the normalized speed of Hibernate with H2 embedded database (7.9) reveals that in these tests, Hibernate with H2 embedded is 9.0 times faster than DataNucleus with MySQL server.

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.64) to the normalized speed of Hibernate with H2 embedded database (16.2) reveals that in that case, Hibernate with H2 embedded is 25.3 times faster than DataNucleus with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test0.7019.71.311.41.015.5
Element Collection Test0.176.90.404.50.295.7
Inheritance Test0.4115.61.312.90.8714.2
Indexing Test1.723.21.912.41.817.8
Graph (Binary Tree) Test0.494.00.464.20.474.1
Multithreading Testfailed27.4failed22.7failed25.0
All Tests0.6916.11.111.40.8913.7

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

The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with MySQL server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with MySQL database server (0.89) to the normalized speed of Hibernate with H2 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 15.4 times faster than DataNucleus with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.17) to the normalized speed of Hibernate with H2 embedded database (6.9) reveals that in that case, Hibernate with H2 embedded is 40.6 times faster than DataNucleus with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
Basic Person Test2.414.23.18.32.711.2
Element Collection Test1.57.20.474.40.995.8
Inheritance Test1.412.22.99.92.111.0
Indexing Test1.416.13.812.82.614.5
Graph (Binary Tree) Test1.27.01.47.71.37.3
Multithreading Test2.419.65.110.93.515.2
All Tests1.712.92.69.02.111.0

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

A huge performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with MySQL database server (1.4) to the normalized speed of Hibernate with H2 embedded database (16.1) reveals that in that case, Hibernate with H2 embedded is 11.5 times faster than DataNucleus with MySQL server.

Other Head to Head DBMS/JPA Comparisons