Compare with

Comparison of Hibernate with HSQLDB embedded vs DataNucleus 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
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test32.64.613.12.822.93.7
Element Collection Test15.12.48.21.611.72.0
Inheritance Test25.54.613.62.719.53.7
Indexing Test29.67.618.84.824.26.2
Graph (Binary Tree) Test13.81.615.61.414.71.5
Multithreading Test37.48.613.03.325.25.9
All Tests25.64.913.72.819.73.8

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test24.86.816.414.920.610.9
Element Collection Test11.35.410.87.611.06.5
Inheritance Test21.78.821.014.821.311.8
Indexing Test11.99.221.514.116.711.6
Graph (Binary Tree) Test3.69.94.715.84.112.9
Multithreading Test19.811.921.511.520.611.7
All Tests15.58.716.013.115.710.9

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

On the other hand, Hibernate with HSQLDB embedded is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (4.7) to the normalized speed of DataNucleus with Derby embedded database (15.8) reveals that in that case, Hibernate with HSQLDB embedded is 3.4 times slower than DataNucleus with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test3.639.10.887.52.223.3
Element Collection Test3.446.01.76.72.626.3
Inheritance Test2.97.71.03.81.95.7
Indexing Test9.90.05321.78.015.84.0
Multithreading Test1.1failed0.58failed0.82failed
All Tests4.223.25.26.54.714.8

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

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (3.4) to the normalized speed of DataNucleus with Derby embedded database (46.0) reveals that in that case, DataNucleus with Derby embedded is 13.5 times faster than Hibernate with HSQLDB embedded.

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (0.053) to the normalized speed of Hibernate with HSQLDB embedded database (9.9) reveals that in that case, DataNucleus with Derby embedded is 187 times slower than Hibernate with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test14.24.05.03.89.63.9
Element Collection Test10.13.75.64.57.84.1
Inheritance Test13.44.47.54.810.54.6
Indexing Test10.75.26.14.28.44.7
Graph (Binary Tree) Test3.72.72.51.53.12.1
Multithreading Test23.9failed3.8failed13.9failed
All Tests12.74.05.13.78.93.9

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

The results above show that in general Hibernate with HSQLDB embedded is more efficient than DataNucleus with Derby embedded in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby embedded database (3.9) to the normalized speed of Hibernate with HSQLDB embedded database (8.9) reveals that in these tests, Hibernate with HSQLDB embedded is 2.3 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (4.0) to the normalized speed of Hibernate with HSQLDB embedded database (14.2) reveals that in that case, Hibernate with HSQLDB embedded is 3.6 times faster than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test26.13.517.51.321.82.4
Element Collection Test9.11.95.21.67.11.7
Inheritance Test21.42.417.71.319.61.9
Indexing Test33.06.616.31.924.74.3
Graph (Binary Tree) Test5.40.818.20.936.80.87
Multithreading Test38.5failed28.6failed33.5failed
All Tests22.33.015.61.418.92.2

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

The results above show that in general Hibernate with HSQLDB embedded is much more efficient than DataNucleus with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby embedded database (2.2) to the normalized speed of Hibernate with HSQLDB embedded database (18.9) reveals that in these tests, Hibernate with HSQLDB embedded is 8.6 times faster than DataNucleus with Derby embedded.

A huge performance gap has been detected when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.3) to the normalized speed of Hibernate with HSQLDB embedded database (17.7) reveals that in that case, Hibernate with HSQLDB embedded is 13.6 times faster than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test41.453.341.453.341.453.3
Element Collection Test46.942.646.942.646.942.6
Inheritance Test41.448.141.448.141.448.1
Indexing Test48.462.349.263.348.862.8
Graph (Binary Tree) Test28.513.621.410.225.011.9
Multithreading Test51.952.010.38.031.130.0
All Tests43.145.335.137.639.141.5

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

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized score of DataNucleus with Derby embedded database (10.2) to the normalized score of Hibernate with HSQLDB embedded database (21.4) reveals that in that case, DataNucleus with Derby embedded is 2.1 times less efficient than Hibernate with HSQLDB embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Hibernate
HSQLDB embedded
DataNucleus
Derby embedded
Basic Person Test20.211.610.66.115.48.8
Element Collection Test9.811.96.34.48.08.1
Inheritance Test17.05.612.25.514.65.5
Indexing Test19.05.716.96.618.06.2
Graph (Binary Tree) Test6.63.77.84.97.24.3
Multithreading Test24.110.313.57.418.88.8
All Tests16.58.011.35.713.96.9

The results above show that in general Hibernate with HSQLDB embedded is more efficient than DataNucleus with Derby embedded in performing JPA database operations. Comparing the normalized speed of DataNucleus with Derby embedded database (6.9) to the normalized speed of Hibernate with HSQLDB embedded database (13.9) reveals that in these tests, Hibernate with HSQLDB embedded is 2.0 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (5.7) to the normalized speed of Hibernate with HSQLDB embedded database (19.0) reveals that in that case, Hibernate with HSQLDB embedded is 3.3 times faster than DataNucleus with Derby embedded.

Other Head to Head DBMS/JPA Comparisons