Compare with

Comparison of DataNucleus with H2 embedded vs Hibernate with Derby embedded

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
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test19.25.98.03.813.64.9
Element Collection Test6.62.92.81.84.72.3
Inheritance Test15.65.34.43.710.04.5
Indexing Test24.47.011.84.818.15.9
Graph (Binary Tree) Test9.21.96.21.77.71.8
Multithreading Test34.910.57.13.721.07.1
All Tests18.35.66.73.312.54.4

The results above show that in general DataNucleus with H2 embedded is more efficient than Hibernate with Derby embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with Derby embedded database (4.4) to the normalized speed of DataNucleus with H2 embedded database (12.5) reveals that in these tests, DataNucleus with H2 embedded is 2.8 times faster than Hibernate with Derby embedded.

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (1.9) to the normalized speed of DataNucleus with H2 embedded database (9.2) reveals that in that case, DataNucleus with H2 embedded is 4.8 times faster than Hibernate with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test13.214.213.516.413.315.3
Element Collection Test6.44.48.94.97.74.6
Inheritance Test12.210.312.718.612.414.4
Indexing Test8.110.016.516.412.313.2
Graph (Binary Tree) Test10.62.620.93.015.82.8
Multithreading Test13.319.39.919.311.619.3
All Tests10.610.113.713.112.211.6

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

A large performance gap has been detected when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (3.0) to the normalized speed of DataNucleus with H2 embedded database (20.9) reveals that in that case, DataNucleus with H2 embedded is 7.0 times faster than Hibernate with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test4.749.31.46.83.128.1
Element Collection Test5.037.62.42.73.720.1
Inheritance Test3.824.11.67.62.715.9
Indexing Test0.00415.31.814.80.9110.1
Multithreading Test1.239.70.796.11.022.9
All Tests3.031.21.67.62.319.4

The results above show that in general Hibernate with Derby embedded is much more efficient than DataNucleus with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 embedded database (2.3) to the normalized speed of Hibernate with Derby embedded database (19.4) reveals that in these tests, Hibernate with Derby embedded is 8.4 times faster than DataNucleus with H2 embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (0.0041) to the normalized speed of Hibernate with Derby embedded database (5.3) reveals that in that case, Hibernate with Derby embedded is 1,293 times faster than DataNucleus with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test10.04.53.93.26.93.8
Element Collection Test7.63.93.93.15.83.5
Inheritance Test9.44.64.44.56.94.5
Indexing Test10.64.65.95.58.25.1
Graph (Binary Tree) Test5.92.73.71.24.82.0
Multithreading Testfailed11.6failed2.6failed7.1
All Tests8.75.34.43.36.54.3

DataNucleus with H2 embedded has failed in 2 tests (see exceptions).

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

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (1.2) to the normalized speed of DataNucleus with H2 embedded database (3.7) reveals that in that case, DataNucleus with H2 embedded is 3.1 times faster than Hibernate with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test4.23.81.34.22.84.0
Element Collection Test4.92.31.61.53.21.9
Inheritance Test4.04.01.34.32.74.2
Indexing Test7.55.51.93.64.74.6
Graph (Binary Tree) Test5.60.744.10.964.80.85
Multithreading Testfailed5.6failed4.9failed5.3
All Tests5.23.72.03.33.63.5

DataNucleus with H2 embedded has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with H2 embedded is slightly more efficient than Hibernate with Derby embedded 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 Hibernate with Derby embedded database (0.74) to the normalized speed of DataNucleus with H2 embedded database (5.6) reveals that in that case, DataNucleus with H2 embedded is 7.6 times faster than Hibernate with Derby embedded.

On the other hand, DataNucleus with H2 embedded is slower, for instance, when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with H2 embedded database (1.3) to the normalized speed of Hibernate with Derby embedded database (4.3) reveals that in that case, DataNucleus with H2 embedded is 3.3 times slower than Hibernate with Derby embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test27.052.727.052.727.052.7
Element Collection Test22.442.322.442.322.442.3
Inheritance Test27.049.227.049.227.049.2
Indexing Test31.653.032.153.931.953.4
Graph (Binary Tree) Test20.013.115.09.817.511.5
Multithreading Test33.949.39.28.821.529.0
All Tests27.043.322.136.124.639.7

The results above show that in general Hibernate with Derby embedded is more efficient than DataNucleus with H2 embedded in using disk space.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
DataNucleus
H2 embedded
Hibernate
Derby embedded
Basic Person Test10.315.55.66.97.911.2
Element Collection Test6.110.23.92.85.06.5
Inheritance Test9.09.74.97.76.98.7
Indexing Test10.16.57.69.08.97.8
Graph (Binary Tree) Test7.82.08.71.78.31.8
Multithreading Test16.517.35.97.311.212.3
All Tests9.610.56.06.17.88.3

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

On the other hand, Hibernate with Derby embedded is slower, for instance, when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of Hibernate with Derby embedded database (1.7) to the normalized speed of DataNucleus with H2 embedded database (8.7) reveals that in that case, Hibernate with Derby embedded is 5.1 times slower than DataNucleus with H2 embedded.

Other Head to Head DBMS/JPA Comparisons