Compare with

Comparison of DataNucleus with HSQLDB embedded vs Hibernate 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
 DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test14.24.64.83.09.53.8
Element Collection Test6.63.72.11.14.32.4
Inheritance Test13.66.74.63.19.14.9
Indexing Test24.68.211.14.217.86.2
Graph (Binary Tree) Test6.83.44.53.95.73.7
Multithreading Test38.56.88.55.023.55.9
All Tests17.45.65.93.411.74.5

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test6.63.110.26.08.44.6
Element Collection Test3.61.08.11.15.81.0
Inheritance Test5.72.98.87.67.25.2
Indexing Test5.12.69.57.07.34.8
Graph (Binary Tree) Test7.20.429.31.18.30.78
Multithreading Test8.16.59.510.58.88.5
All Tests6.02.89.25.67.64.2

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

A huge performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (0.42) to the normalized speed of DataNucleus with HSQLDB embedded database (7.2) reveals that in that case, DataNucleus with HSQLDB embedded is 17.1 times faster than Hibernate with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test1.43.70.481.00.952.3
Element Collection Test1.33.70.670.631.02.2
Inheritance Test1.63.20.611.41.12.3
Indexing Test0.00161.70.635.80.323.8
Multithreading Test0.401.1failed0.880.401.0
All Tests0.962.70.601.90.802.3

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

The results above show that in general Hibernate with H2 server is 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 H2 database server (2.3) reveals that in these tests, Hibernate with H2 server is 2.9 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 H2 database server (1.7) reveals that in that case, Hibernate with H2 server is 1,062 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
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test11.52.92.71.87.12.4
Element Collection Test6.92.62.71.14.81.9
Inheritance Test10.33.23.62.56.92.9
Indexing Test11.42.94.42.77.92.8
Graph (Binary Tree) Test3.51.21.50.432.50.79
Multithreading Testfailed5.6failed2.4failed4.0
All Tests8.73.13.01.85.82.5

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test4.23.81.32.42.83.1
Element Collection Test4.91.91.61.13.21.5
Inheritance Test4.03.71.32.52.73.1
Indexing Test7.57.61.93.14.75.3
Graph (Binary Tree) Test2.90.992.00.912.50.95
Multithreading Test40.16.113.77.326.96.7
All Tests10.64.03.72.97.13.5

The results above show that in general DataNucleus with HSQLDB embedded is more efficient than Hibernate with H2 server in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with H2 database server (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 H2 server.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
Basic Person Test7.63.63.92.85.73.2
Element Collection Test4.72.63.01.03.81.8
Inheritance Test7.14.03.83.45.43.7
Indexing Test9.74.65.54.57.64.6
Graph (Binary Tree) Test5.11.54.31.64.71.6
Multithreading Test21.85.210.65.217.05.2
All Tests9.03.74.83.27.03.4

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of Hibernate with H2 database server (5.2) to the normalized speed of DataNucleus with HSQLDB embedded database (21.8) reveals that in that case, DataNucleus with HSQLDB embedded is 4.2 times faster than Hibernate with H2 server.

Other Head to Head DBMS/JPA Comparisons