Compare with

Comparison of Hibernate with MySQL server vs DataNucleus with H2 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
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test3.63.41.62.22.62.8
Element Collection Test1.61.20.720.641.10.92
Inheritance Test3.73.01.61.92.72.4
Indexing Test5.45.32.63.54.04.4
Graph (Binary Tree) Test1.52.11.21.31.41.7
Multithreading Test7.410.02.94.35.27.2
All Tests3.94.21.82.32.83.2

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
 Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test3.02.511.05.27.03.9
Element Collection Test0.340.561.21.10.790.82
Inheritance Test1.32.214.56.17.94.2
Indexing Test2.52.112.87.77.64.9
Graph (Binary Tree) Test0.555.70.718.90.637.3
Multithreading Test0.232.313.88.77.05.5
All Tests1.32.59.06.35.24.4

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
 Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test10.04.12.01.36.02.7
Element Collection Test6.74.00.530.493.62.3
Inheritance Test2.82.91.61.52.22.2
Indexing Test0.440.00362.01.51.20.75
Multithreading Test2.11.30.98failed1.51.3
All Tests4.42.51.41.22.91.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
 Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test0.732.51.61.41.21.9
Element Collection Test0.392.01.21.00.781.5
Inheritance Test0.612.42.12.31.42.3
Indexing Test0.812.72.63.01.72.9
Graph (Binary Tree) Test0.691.80.400.600.541.2
Multithreading Test0.63failed3.0failed1.8failed
All Tests0.642.31.81.71.22.0

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
 Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test1.13.41.71.31.42.3
Element Collection Test0.211.50.530.680.371.1
Inheritance Test0.652.71.81.31.22.0
Indexing Test0.815.72.01.91.43.8
Graph (Binary Tree) Test0.551.50.621.20.581.3
Multithreading Test0.35failed4.15.12.25.1
All Tests0.613.01.81.91.22.4

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
 Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Hibernate
MySQL server
DataNucleus
H2 server
Basic Person Test3.73.23.62.33.62.7
Element Collection Test1.81.90.840.781.31.3
Inheritance Test1.82.64.32.63.12.6
Indexing Test2.03.24.43.53.23.3
Graph (Binary Tree) Test0.832.80.733.00.782.9
Multithreading Test2.14.55.06.03.65.3
All Tests2.12.93.22.82.72.9

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