Compare with

Comparison of Hibernate with HSQLDB embedded vs DataNucleus with H2 server

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
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test32.63.413.12.222.92.8
Element Collection Test15.11.28.20.6411.70.92
Inheritance Test25.53.013.61.919.52.4
Indexing Test29.65.318.83.524.24.4
Graph (Binary Tree) Test13.82.115.61.314.71.7
Multithreading Test37.410.013.04.325.27.2
All Tests25.64.213.72.319.73.2

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
 Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test24.82.516.45.220.63.9
Element Collection Test11.30.5610.81.111.00.82
Inheritance Test21.72.221.06.121.34.2
Indexing Test11.92.121.57.716.74.9
Graph (Binary Tree) Test3.65.74.78.94.17.3
Multithreading Test19.82.321.58.720.65.5
All Tests15.52.516.06.315.74.4

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
 Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test3.64.10.881.32.22.7
Element Collection Test3.44.01.70.492.62.3
Inheritance Test2.92.91.01.51.92.2
Indexing Test9.90.003621.71.515.80.75
Multithreading Test1.11.30.58failed0.821.3
All Tests4.22.55.21.24.71.9

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
 Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test14.22.55.01.49.61.9
Element Collection Test10.12.05.61.07.81.5
Inheritance Test13.42.47.52.310.52.3
Indexing Test10.72.76.13.08.42.9
Graph (Binary Tree) Test3.71.82.50.603.11.2
Multithreading Test23.9failed3.8failed13.9failed
All Tests12.72.35.11.78.92.0

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
 Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test26.13.417.51.321.82.3
Element Collection Test9.11.55.20.687.11.1
Inheritance Test21.42.717.71.319.62.0
Indexing Test33.05.716.31.924.73.8
Graph (Binary Tree) Test5.41.58.21.26.81.3
Multithreading Test38.5failed28.65.133.55.1
All Tests22.33.015.61.918.92.4

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
 Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Hibernate
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test20.23.210.62.315.42.7
Element Collection Test9.81.96.30.788.01.3
Inheritance Test17.02.612.22.614.62.6
Indexing Test19.03.216.93.518.03.3
Graph (Binary Tree) Test6.62.87.83.07.22.9
Multithreading Test24.14.513.56.018.85.3
All Tests16.52.911.32.813.92.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