Compare with

Comparison of Hibernate with H2 embedded vs DataNucleus with MySQL 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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test18.12.69.01.413.52.0
Element Collection Test13.01.06.80.489.90.76
Inheritance Test21.02.59.41.315.21.9
Indexing Test29.94.018.42.524.13.3
Graph (Binary Tree) Test17.21.120.10.9918.71.1
Multithreading Test36.96.211.52.524.24.4
All Tests22.62.912.51.517.62.2

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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test16.60.9613.39.315.05.1
Element Collection Test4.30.184.00.774.10.47
Inheritance Test10.40.5517.58.513.94.5
Indexing Test10.80.8215.29.713.05.3
Graph (Binary Tree) Test2.52.14.03.53.32.8
Multithreading Test16.20.2715.77.815.94.0
All Tests10.10.8111.66.610.93.7

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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test4.57.21.22.22.84.7
Element Collection Test4.45.81.40.272.93.1
Inheritance Test3.12.91.51.72.32.3
Indexing Test6.60.008410.52.58.61.2
Multithreading Test1.2failed0.59failed0.89failed
All Tests4.04.03.01.73.52.8

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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test12.10.616.51.19.30.88
Element Collection Test7.40.315.30.446.30.38
Inheritance Test10.80.518.51.89.61.1
Indexing Test10.00.687.52.28.81.5
Graph (Binary Tree) Test4.40.912.30.473.40.69
Multithreading Test16.20.644.0failed10.10.64
All Tests10.10.615.71.27.90.88

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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test19.70.7011.41.315.51.0
Element Collection Test6.90.174.50.405.70.29
Inheritance Test15.60.4112.91.314.20.87
Indexing Test23.21.712.41.917.81.8
Graph (Binary Tree) Test4.00.494.20.464.10.47
Multithreading Test27.4failed22.7failed25.0failed
All Tests16.10.6911.41.113.70.89

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
 Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Hibernate
H2 embedded
DataNucleus
MySQL server
Basic Person Test14.22.48.33.111.22.7
Element Collection Test7.21.54.40.475.80.99
Inheritance Test12.21.49.92.911.02.1
Indexing Test16.11.412.83.814.52.6
Graph (Binary Tree) Test7.01.27.71.47.31.3
Multithreading Test19.62.410.95.115.23.5
All Tests12.91.79.02.611.02.1

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