Compare with

Comparison of Hibernate with H2 server 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 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test4.62.63.01.43.82.0
Element Collection Test3.71.01.10.482.40.76
Inheritance Test6.72.53.11.34.91.9
Indexing Test8.24.04.22.56.23.3
Graph (Binary Tree) Test3.41.13.90.993.71.1
Multithreading Test6.86.25.02.55.94.4
All Tests5.62.93.41.54.52.2

The results above show that in general Hibernate with H2 server is 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 database server (4.5) reveals that in these tests, Hibernate with H2 server is 2.0 times faster than DataNucleus with MySQL server.

A large 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 database server (3.9) reveals that in that case, Hibernate with H2 server is 3.9 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 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test3.10.966.09.34.65.1
Element Collection Test1.00.181.10.771.00.47
Inheritance Test2.90.557.68.55.24.5
Indexing Test2.60.827.09.74.85.3
Graph (Binary Tree) Test0.422.11.13.50.782.8
Multithreading Test6.50.2710.57.88.54.0
All Tests2.80.815.66.64.23.7

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

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 database server (6.5) reveals that in that case, Hibernate with H2 server is 24.1 times faster than DataNucleus with MySQL server.

On the other hand, Hibernate with H2 server is slower, for instance, when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (0.42) to the normalized speed of DataNucleus with MySQL database server (2.1) reveals that in that case, Hibernate with H2 server is 5.0 times slower 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 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test3.77.21.02.22.34.7
Element Collection Test3.75.80.630.272.23.1
Inheritance Test3.22.91.41.72.32.3
Indexing Test1.70.00845.82.53.81.2
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.74.01.91.72.32.8

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

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

A large performance gap has been detected when using simple basic entities with large retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.0) to the normalized speed of DataNucleus with MySQL database server (2.2) reveals that in that case, DataNucleus with MySQL server is 2.2 times faster than Hibernate with H2 server.

On the other hand, DataNucleus with MySQL server is slower, for instance, 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 database server (1.7) reveals that in that case, DataNucleus with MySQL server is 202 times slower than Hibernate with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test2.90.611.81.12.40.88
Element Collection Test2.60.311.10.441.90.38
Inheritance Test3.20.512.51.82.91.1
Indexing Test2.90.682.72.22.81.5
Graph (Binary Tree) Test1.20.910.430.470.790.69
Multithreading Test5.60.642.4failed4.00.64
All Tests3.10.611.81.22.50.88

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

The results above show that in general Hibernate with H2 server is 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 database server (2.5) reveals that in these tests, Hibernate with H2 server is 2.8 times faster than DataNucleus with MySQL server.

A large 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 database server (5.6) reveals that in that case, Hibernate with H2 server is 8.8 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 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test3.80.702.41.33.11.0
Element Collection Test1.90.171.10.401.50.29
Inheritance Test3.70.412.51.33.10.87
Indexing Test7.61.73.11.95.31.8
Graph (Binary Tree) Test0.990.490.910.460.950.47
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.00.692.91.13.50.89

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

The results above show that in general Hibernate with H2 server 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 database server (3.5) reveals that in these tests, Hibernate with H2 server is 3.9 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 database server (1.9) reveals that in that case, Hibernate with H2 server is 11.2 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 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Hibernate
H2 server
DataNucleus
MySQL server
Basic Person Test3.62.42.83.13.22.7
Element Collection Test2.61.51.00.471.80.99
Inheritance Test4.01.43.42.93.72.1
Indexing Test4.61.44.53.84.62.6
Graph (Binary Tree) Test1.51.21.61.41.61.3
Multithreading Test5.22.45.25.15.23.5
All Tests3.71.73.22.63.42.1

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

A large 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 database server (4.6) reveals that in that case, Hibernate with H2 server is 3.3 times faster than DataNucleus with MySQL server.

Other Head to Head DBMS/JPA Comparisons