Compare with

Comparison of DataNucleus with H2 server vs Hibernate 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
 DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test3.43.62.21.62.82.6
Element Collection Test1.21.60.640.720.921.1
Inheritance Test3.03.71.91.62.42.7
Indexing Test5.35.43.52.64.44.0
Graph (Binary Tree) Test2.11.51.31.21.71.4
Multithreading Test10.07.44.32.97.25.2
All Tests4.23.92.31.83.22.8

The results above show that in general DataNucleus with H2 server is slightly more efficient than Hibernate with MySQL server in persisting JPA entity objects to the database.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test2.53.05.211.03.97.0
Element Collection Test0.560.341.11.20.820.79
Inheritance Test2.21.36.114.54.27.9
Indexing Test2.12.57.712.84.97.6
Graph (Binary Tree) Test5.70.558.90.717.30.63
Multithreading Test2.30.238.713.85.57.0
All Tests2.51.36.39.04.45.2

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

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

On the other hand, Hibernate with MySQL server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.71) to the normalized speed of DataNucleus with H2 database server (8.9) reveals that in that case, Hibernate with MySQL server is 12.5 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
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test4.110.01.32.02.76.0
Element Collection Test4.06.70.490.532.33.6
Inheritance Test2.92.81.51.62.22.2
Indexing Test0.00360.441.52.00.751.2
Multithreading Test1.32.1failed0.981.31.5
All Tests2.54.41.21.41.92.9

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

The results above show that in general Hibernate with MySQL server is more efficient than DataNucleus with H2 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 H2 database server (0.0036) to the normalized speed of Hibernate with MySQL database server (0.44) reveals that in that case, Hibernate with MySQL server is 122 times faster 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
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test2.50.731.41.61.91.2
Element Collection Test2.00.391.01.21.50.78
Inheritance Test2.40.612.32.12.31.4
Indexing Test2.70.813.02.62.91.7
Graph (Binary Tree) Test1.80.690.600.401.20.54
Multithreading Testfailed0.63failed3.0failed1.8
All Tests2.30.641.71.82.01.2

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test3.41.11.31.72.31.4
Element Collection Test1.50.210.680.531.10.37
Inheritance Test2.70.651.31.82.01.2
Indexing Test5.70.811.92.03.81.4
Graph (Binary Tree) Test1.50.551.20.621.30.58
Multithreading Testfailed0.355.14.15.12.2
All Tests3.00.611.91.82.41.2

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

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
Basic Person Test3.23.72.33.62.73.6
Element Collection Test1.91.80.780.841.31.3
Inheritance Test2.61.82.64.32.63.1
Indexing Test3.22.03.54.43.33.2
Graph (Binary Tree) Test2.80.833.00.732.90.78
Multithreading Test4.52.16.05.05.33.6
All Tests2.92.12.83.22.92.7

The results above show that in general DataNucleus with H2 server is slightly more efficient than Hibernate with MySQL server in performing JPA database operations.

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.73) to the normalized speed of DataNucleus with H2 database server (3.0) reveals that in that case, DataNucleus with H2 server is 4.1 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons