Compare with

Comparison of DataNucleus with MySQL server vs Hibernate with Derby 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
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test2.63.81.43.02.03.4
Element Collection Test1.02.00.481.30.761.7
Inheritance Test2.53.41.33.01.93.2
Indexing Test4.04.82.54.13.34.4
Graph (Binary Tree) Test1.11.80.991.61.11.7
Multithreading Test6.26.92.53.94.45.4
All Tests2.93.81.52.82.23.3

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.48) to the normalized speed of Hibernate with Derby database server (1.3) reveals that in that case, Hibernate with Derby server is 2.7 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
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test0.963.89.38.45.16.1
Element Collection Test0.181.00.771.00.471.0
Inheritance Test0.553.58.59.74.56.6
Indexing Test0.823.29.79.55.36.4
Graph (Binary Tree) Test2.10.913.51.22.81.1
Multithreading Test0.277.87.813.44.010.6
All Tests0.813.46.67.23.75.3

The results above show that in general Hibernate with Derby server is 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 Derby database server (7.8) reveals that in that case, Hibernate with Derby server is 28.9 times faster than DataNucleus with MySQL server.

On the other hand, Hibernate with Derby server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with Derby database server (1.2) to the normalized speed of DataNucleus with MySQL database server (3.5) reveals that in that case, Hibernate with Derby server is 2.9 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
 DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test7.234.02.24.14.719.1
Element Collection Test5.833.80.270.643.117.2
Inheritance Test2.920.51.75.02.312.8
Indexing Test0.00842.02.59.21.25.6
Multithreading Testfailed36.2failed5.1failed20.6
All Tests4.025.31.74.82.815.1

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

The results above show that in general Hibernate with Derby server is much more efficient than DataNucleus with MySQL server in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with MySQL database server (2.8) to the normalized speed of Hibernate with Derby database server (15.1) reveals that in these tests, Hibernate with Derby server is 5.4 times faster than DataNucleus with MySQL server.

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 Derby database server (2.0) reveals that in that case, Hibernate with Derby server is 238 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
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test0.612.91.12.50.882.7
Element Collection Test0.312.30.441.50.381.9
Inheritance Test0.512.91.83.51.13.2
Indexing Test0.683.02.24.21.53.6
Graph (Binary Tree) Test0.911.20.470.580.690.91
Multithreading Test0.646.8failed2.50.644.6
All Tests0.613.21.22.50.882.8

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

The results above show that in general Hibernate with Derby server 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 Derby database server (2.8) reveals that in these tests, Hibernate with Derby server is 3.2 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 Derby database server (6.8) reveals that in that case, Hibernate with Derby server is 10.6 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
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test0.702.91.33.51.03.2
Element Collection Test0.171.70.400.870.291.3
Inheritance Test0.412.91.33.60.873.2
Indexing Test1.73.71.93.61.83.7
Graph (Binary Tree) Test0.490.690.460.700.470.70
Multithreading Testfailed6.2failed5.1failed5.6
All Tests0.693.01.12.90.893.0

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

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

A large 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 Derby database server (1.7) reveals that in that case, Hibernate with Derby server is 10.0 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
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
DataNucleus
MySQL server
Hibernate
Derby server
Basic Person Test2.49.53.14.32.76.9
Element Collection Test1.58.20.471.10.994.6
Inheritance Test1.46.62.95.02.15.8
Indexing Test1.43.33.86.12.64.7
Graph (Binary Tree) Test1.21.21.41.01.31.1
Multithreading Test2.412.85.16.03.59.4
All Tests1.77.12.64.02.15.6

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

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

Other Head to Head DBMS/JPA Comparisons