Compare with

Comparison of Hibernate with Derby embedded 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
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test5.92.63.81.44.92.0
Element Collection Test2.91.01.80.482.30.76
Inheritance Test5.32.53.71.34.51.9
Indexing Test7.04.04.82.55.93.3
Graph (Binary Tree) Test1.91.11.70.991.81.1
Multithreading Test10.56.23.72.57.14.4
All Tests5.62.93.31.54.42.2

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

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 embedded database (1.8) reveals that in that case, Hibernate with Derby embedded is 3.8 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
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test14.20.9616.49.315.35.1
Element Collection Test4.40.184.90.774.60.47
Inheritance Test10.30.5518.68.514.44.5
Indexing Test10.00.8216.49.713.25.3
Graph (Binary Tree) Test2.62.13.03.52.82.8
Multithreading Test19.30.2719.37.819.34.0
All Tests10.10.8113.16.611.63.7

The results above show that in general Hibernate with Derby embedded is much more efficient than DataNucleus with MySQL server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with MySQL database server (3.7) to the normalized speed of Hibernate with Derby embedded database (11.6) reveals that in these tests, Hibernate with Derby embedded is 3.1 times faster than DataNucleus with MySQL server.

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 embedded database (19.3) reveals that in that case, Hibernate with Derby embedded is 71.5 times faster than DataNucleus with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test49.37.26.82.228.14.7
Element Collection Test37.65.82.70.2720.13.1
Inheritance Test24.12.97.61.715.92.3
Indexing Test5.30.008414.82.510.11.2
Multithreading Test39.7failed6.1failed22.9failed
All Tests31.24.07.61.719.42.8

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

The results above show that in general Hibernate with Derby embedded 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 embedded database (19.4) reveals that in these tests, Hibernate with Derby embedded is 6.9 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 embedded database (5.3) reveals that in that case, Hibernate with Derby embedded is 631 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
 Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test4.50.613.21.13.80.88
Element Collection Test3.90.313.10.443.50.38
Inheritance Test4.60.514.51.84.51.1
Indexing Test4.60.685.52.25.11.5
Graph (Binary Tree) Test2.70.911.20.472.00.69
Multithreading Test11.60.642.6failed7.10.64
All Tests5.30.613.31.24.30.88

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

The results above show that in general Hibernate with Derby embedded 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 embedded database (4.3) reveals that in these tests, Hibernate with Derby embedded is 4.9 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 embedded database (11.6) reveals that in that case, Hibernate with Derby embedded is 18.1 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
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test3.80.704.21.34.01.0
Element Collection Test2.30.171.50.401.90.29
Inheritance Test4.00.414.31.34.20.87
Indexing Test5.51.73.61.94.61.8
Graph (Binary Tree) Test0.740.490.960.460.850.47
Multithreading Test5.6failed4.9failed5.3failed
All Tests3.70.693.31.13.50.89

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

The results above show that in general Hibernate with Derby embedded 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 embedded database (3.5) reveals that in these tests, Hibernate with Derby embedded 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 Derby embedded database (2.3) reveals that in that case, Hibernate with Derby embedded is 13.5 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
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Hibernate
Derby embedded
DataNucleus
MySQL server
Basic Person Test15.52.46.93.111.22.7
Element Collection Test10.21.52.80.476.50.99
Inheritance Test9.71.47.72.98.72.1
Indexing Test6.51.49.03.87.82.6
Graph (Binary Tree) Test2.01.21.71.41.81.3
Multithreading Test17.32.47.35.112.33.5
All Tests10.51.76.12.68.32.1

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with MySQL database server (2.4) to the normalized speed of Hibernate with Derby embedded database (17.3) reveals that in that case, Hibernate with Derby embedded is 7.2 times faster than DataNucleus with MySQL server.

Other Head to Head DBMS/JPA Comparisons