Compare with

Comparison of DataNucleus with Derby server vs Hibernate with HSQLDB 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
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test2.832.62.313.12.622.9
Element Collection Test0.7115.10.358.20.5311.7
Inheritance Test2.725.52.013.62.319.5
Indexing Test4.529.64.018.84.324.2
Graph (Binary Tree) Test0.6213.80.5315.60.5714.7
Multithreading Test4.937.43.413.04.125.2
All Tests2.725.62.113.72.419.7

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with Derby database server (0.53) to the normalized speed of Hibernate with HSQLDB embedded database (15.6) reveals that in that case, Hibernate with HSQLDB embedded is 29.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
 DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test0.5624.86.316.43.420.6
Element Collection Test0.3611.30.9310.80.6411.0
Inheritance Test0.4521.76.821.03.621.3
Indexing Test0.5011.97.121.53.816.7
Graph (Binary Tree) Test0.223.66.64.73.44.1
Multithreading Test1.219.810.021.55.620.6
All Tests0.5515.56.316.03.415.7

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

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.45) to the normalized speed of Hibernate with HSQLDB embedded database (21.7) reveals that in that case, Hibernate with HSQLDB embedded is 48.2 times faster than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test37.73.63.60.8820.72.2
Element Collection Test25.93.41.41.713.62.6
Inheritance Test6.52.91.81.04.21.9
Indexing Test0.0309.94.921.72.515.8
Multithreading Testfailed1.1failed0.58failed0.82
All Tests17.54.22.95.210.24.7

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

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

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

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 HSQLDB embedded database (9.9) reveals that in that case, DataNucleus with Derby server is 330 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
 DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test1.114.20.855.00.999.6
Element Collection Test0.8110.10.625.60.717.8
Inheritance Test1.213.41.37.51.210.5
Indexing Test1.210.71.56.11.38.4
Graph (Binary Tree) Test0.293.70.412.50.353.1
Multithreading Testfailed23.9failed3.8failed13.9
All Tests0.9312.70.925.10.928.9

DataNucleus with Derby server 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 server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby database server (0.92) to the normalized speed of Hibernate with HSQLDB embedded database (8.9) reveals that in these tests, Hibernate with HSQLDB embedded is 9.7 times faster than DataNucleus with Derby server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test1.326.11.317.51.321.8
Element Collection Test0.619.10.335.20.477.1
Inheritance Test1.021.41.317.71.219.6
Indexing Test2.333.01.916.32.124.7
Graph (Binary Tree) Test0.265.40.468.20.366.8
Multithreading Testfailed38.5failed28.6failed33.5
All Tests1.122.31.115.61.118.9

DataNucleus with Derby server 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 server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby database server (1.1) to the normalized speed of Hibernate with HSQLDB embedded database (18.9) reveals that in these tests, Hibernate with HSQLDB embedded is 17.2 times faster than DataNucleus with Derby server.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
DataNucleus
Derby server
Hibernate
HSQLDB embedded
Basic Person Test8.720.22.910.65.815.4
Element Collection Test5.79.80.726.33.28.0
Inheritance Test2.417.02.612.22.514.6
Indexing Test1.719.03.916.92.818.0
Graph (Binary Tree) Test0.356.62.07.81.27.2
Multithreading Test3.024.16.713.54.918.8
All Tests3.816.52.811.33.313.9

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

A huge performance gap has been detected 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 HSQLDB embedded database (6.6) reveals that in that case, Hibernate with HSQLDB embedded is 18.9 times faster than DataNucleus with Derby server.

Other Head to Head DBMS/JPA Comparisons