Compare with

Comparison of DataNucleus with HSQLDB 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
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test14.25.94.83.89.54.9
Element Collection Test6.62.92.11.84.32.3
Inheritance Test13.65.34.63.79.14.5
Indexing Test24.67.011.14.817.85.9
Graph (Binary Tree) Test6.81.94.51.75.71.8
Multithreading Test38.510.58.53.723.57.1
All Tests17.45.65.93.311.74.4

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (10.5) to the normalized speed of DataNucleus with HSQLDB embedded database (38.5) reveals that in that case, DataNucleus with HSQLDB embedded is 3.7 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
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test6.614.210.216.48.415.3
Element Collection Test3.64.48.14.95.84.6
Inheritance Test5.710.38.818.67.214.4
Indexing Test5.110.09.516.47.313.2
Graph (Binary Tree) Test7.22.69.33.08.32.8
Multithreading Test8.119.39.519.38.819.3
All Tests6.010.19.213.17.611.6

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

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

On the other hand, Hibernate with Derby embedded is slower, for instance, 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 HSQLDB embedded database (9.3) reveals that in that case, Hibernate with Derby embedded is 3.1 times slower than DataNucleus with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test1.449.30.486.80.9528.1
Element Collection Test1.337.60.672.71.020.1
Inheritance Test1.624.10.617.61.115.9
Indexing Test0.00165.30.6314.80.3210.1
Multithreading Test0.4039.7failed6.10.4022.9
All Tests0.9631.20.607.60.8019.4

DataNucleus with HSQLDB embedded 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 HSQLDB embedded in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (0.80) to the normalized speed of Hibernate with Derby embedded database (19.4) reveals that in these tests, Hibernate with Derby embedded is 24.2 times faster than DataNucleus with HSQLDB embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test11.54.52.73.27.13.8
Element Collection Test6.93.92.73.14.83.5
Inheritance Test10.34.63.64.56.94.5
Indexing Test11.44.64.45.57.95.1
Graph (Binary Tree) Test3.52.71.51.22.52.0
Multithreading Testfailed11.6failed2.6failed7.1
All Tests8.75.33.03.35.84.3

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

The results above show that in general DataNucleus with HSQLDB 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 simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with Derby embedded database (4.5) to the normalized speed of DataNucleus with HSQLDB embedded database (11.5) reveals that in that case, DataNucleus with HSQLDB embedded is 2.6 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
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB 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) Test2.90.742.00.962.50.85
Multithreading Test40.15.613.74.926.95.3
All Tests10.63.73.73.37.13.5

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

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

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of Hibernate with Derby embedded database (4.3) reveals that in that case, DataNucleus with HSQLDB 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
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test41.452.741.452.741.452.7
Element Collection Test23.442.323.442.323.442.3
Inheritance Test41.449.241.449.241.449.2
Indexing Test48.453.049.253.948.853.4
Graph (Binary Tree) Test12.513.19.49.810.911.5
Multithreading Test51.949.310.38.831.129.0
All Tests36.543.329.236.132.939.7

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
DataNucleus
HSQLDB embedded
Hibernate
Derby embedded
Basic Person Test7.615.53.96.95.711.2
Element Collection Test4.710.23.02.83.86.5
Inheritance Test7.19.73.87.75.48.7
Indexing Test9.76.55.59.07.67.8
Graph (Binary Tree) Test5.12.04.31.74.71.8
Multithreading Test21.817.310.67.317.012.3
All Tests9.010.54.86.17.08.3

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

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

Other Head to Head DBMS/JPA Comparisons