Compare with

Comparison of DataNucleus with H2 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
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test3.432.62.213.12.822.9
Element Collection Test1.215.10.648.20.9211.7
Inheritance Test3.025.51.913.62.419.5
Indexing Test5.329.63.518.84.424.2
Graph (Binary Tree) Test2.113.81.315.61.714.7
Multithreading Test10.037.44.313.07.225.2
All Tests4.225.62.313.73.219.7

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

A huge performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (0.64) to the normalized speed of Hibernate with HSQLDB embedded database (8.2) reveals that in that case, Hibernate with HSQLDB embedded is 12.8 times faster than DataNucleus with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test2.524.85.216.43.920.6
Element Collection Test0.5611.31.110.80.8211.0
Inheritance Test2.221.76.121.04.221.3
Indexing Test2.111.97.721.54.916.7
Graph (Binary Tree) Test5.73.68.94.77.34.1
Multithreading Test2.319.88.721.55.520.6
All Tests2.515.56.316.04.415.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test4.13.61.30.882.72.2
Element Collection Test4.03.40.491.72.32.6
Inheritance Test2.92.91.51.02.21.9
Indexing Test0.00369.91.521.70.7515.8
Multithreading Test1.31.1failed0.581.30.82
All Tests2.54.21.25.21.94.7

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

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (0.0036) to the normalized speed of Hibernate with HSQLDB embedded database (9.9) reveals that in that case, Hibernate with HSQLDB embedded is 2,750 times faster than DataNucleus with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test2.514.21.45.01.99.6
Element Collection Test2.010.11.05.61.57.8
Inheritance Test2.413.42.37.52.310.5
Indexing Test2.710.73.06.12.98.4
Graph (Binary Tree) Test1.83.70.602.51.23.1
Multithreading Testfailed23.9failed3.8failed13.9
All Tests2.312.71.75.12.08.9

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test3.426.11.317.52.321.8
Element Collection Test1.59.10.685.21.17.1
Inheritance Test2.721.41.317.72.019.6
Indexing Test5.733.01.916.33.824.7
Graph (Binary Tree) Test1.55.41.28.21.36.8
Multithreading Testfailed38.55.128.65.133.5
All Tests3.022.31.915.62.418.9

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

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

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 H2 database server (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 H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
Basic Person Test3.220.22.310.62.715.4
Element Collection Test1.99.80.786.31.38.0
Inheritance Test2.617.02.612.22.614.6
Indexing Test3.219.03.516.93.318.0
Graph (Binary Tree) Test2.86.63.07.82.97.2
Multithreading Test4.524.16.013.55.318.8
All Tests2.916.52.811.32.913.9

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

A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (0.78) to the normalized speed of Hibernate with HSQLDB embedded database (6.3) reveals that in that case, Hibernate with HSQLDB embedded is 8.1 times faster than DataNucleus with H2 server.

Other Head to Head DBMS/JPA Comparisons