Compare with

Comparison of Hibernate with MySQL server vs DataNucleus 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
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test3.62.81.62.32.62.6
Element Collection Test1.60.710.720.351.10.53
Inheritance Test3.72.71.62.02.72.3
Indexing Test5.44.52.64.04.04.3
Graph (Binary Tree) Test1.50.621.20.531.40.57
Multithreading Test7.44.92.93.45.24.1
All Tests3.92.71.82.12.82.4

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (0.62) to the normalized speed of Hibernate with MySQL database server (1.5) reveals that in that case, Hibernate with MySQL server is 2.4 times faster than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test3.00.5611.06.37.03.4
Element Collection Test0.340.361.20.930.790.64
Inheritance Test1.30.4514.56.87.93.6
Indexing Test2.50.5012.87.17.63.8
Graph (Binary Tree) Test0.550.220.716.60.633.4
Multithreading Test0.231.213.810.07.05.6
All Tests1.30.559.06.35.23.4

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

A large performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.56) to the normalized speed of Hibernate with MySQL database server (3.0) reveals that in that case, Hibernate with MySQL server is 5.4 times faster than DataNucleus with Derby 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 Derby database server (6.6) reveals that in that case, Hibernate with MySQL server is 9.3 times slower than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test10.037.72.03.66.020.7
Element Collection Test6.725.90.531.43.613.6
Inheritance Test2.86.51.61.82.24.2
Indexing Test0.440.0302.04.91.22.5
Multithreading Test2.1failed0.98failed1.5failed
All Tests4.417.51.42.92.910.2

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

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

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

On the other hand, DataNucleus with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.030) to the normalized speed of Hibernate with MySQL database server (0.44) reveals that in that case, DataNucleus with Derby server is 14.7 times slower than Hibernate with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test0.731.11.60.851.20.99
Element Collection Test0.390.811.20.620.780.71
Inheritance Test0.611.22.11.31.41.2
Indexing Test0.811.22.61.51.71.3
Graph (Binary Tree) Test0.690.290.400.410.540.35
Multithreading Test0.63failed3.0failed1.8failed
All Tests0.640.931.80.921.20.92

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

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (0.29) to the normalized speed of Hibernate with MySQL database server (0.69) reveals that in that case, Hibernate with MySQL server is 2.4 times faster than DataNucleus with Derby server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test1.11.31.71.31.41.3
Element Collection Test0.210.610.530.330.370.47
Inheritance Test0.651.01.81.31.21.2
Indexing Test0.812.32.01.91.42.1
Graph (Binary Tree) Test0.550.260.620.460.580.36
Multithreading Test0.35failed4.1failed2.2failed
All Tests0.611.11.81.11.21.1

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

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (0.26) to the normalized speed of Hibernate with MySQL database server (0.55) reveals that in that case, Hibernate with MySQL server is 2.1 times faster than DataNucleus with Derby server.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Hibernate
MySQL server
DataNucleus
Derby server
Basic Person Test3.78.73.62.93.65.8
Element Collection Test1.85.70.840.721.33.2
Inheritance Test1.82.44.32.63.12.5
Indexing Test2.01.74.43.93.22.8
Graph (Binary Tree) Test0.830.350.732.00.781.2
Multithreading Test2.13.05.06.73.64.9
All Tests2.13.83.22.82.73.3

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

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

On the other hand, DataNucleus with Derby server is slower, for instance, when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.35) to the normalized speed of Hibernate with MySQL database server (0.83) reveals that in that case, DataNucleus with Derby server is 2.4 times slower than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons