Compare with

Comparison of Hibernate with H2 server vs DataNucleus 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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test4.614.23.04.83.89.5
Element Collection Test3.76.61.12.12.44.3
Inheritance Test6.713.63.14.64.99.1
Indexing Test8.224.64.211.16.217.8
Graph (Binary Tree) Test3.46.83.94.53.75.7
Multithreading Test6.838.55.08.55.923.5
All Tests5.617.43.45.94.511.7

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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.16.66.010.24.68.4
Element Collection Test1.03.61.18.11.05.8
Inheritance Test2.95.77.68.85.27.2
Indexing Test2.65.17.09.54.87.3
Graph (Binary Tree) Test0.427.21.19.30.788.3
Multithreading Test6.58.110.59.58.58.8
All Tests2.86.05.69.24.27.6

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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.71.41.00.482.30.95
Element Collection Test3.71.30.630.672.21.0
Inheritance Test3.21.61.40.612.31.1
Indexing Test1.70.00165.80.633.80.32
Multithreading Test1.10.400.88failed1.00.40
All Tests2.70.961.90.602.30.80

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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test2.911.51.82.72.47.1
Element Collection Test2.66.91.12.71.94.8
Inheritance Test3.210.32.53.62.96.9
Indexing Test2.911.42.74.42.87.9
Graph (Binary Tree) Test1.23.50.431.50.792.5
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.18.71.83.02.55.8

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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.84.22.41.33.12.8
Element Collection Test1.94.91.11.61.53.2
Inheritance Test3.74.02.51.33.12.7
Indexing Test7.67.53.11.95.34.7
Graph (Binary Tree) Test0.992.90.912.00.952.5
Multithreading Test6.140.17.313.76.726.9
All Tests4.010.62.93.73.57.1

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
 Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Hibernate
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.67.62.83.93.25.7
Element Collection Test2.64.71.03.01.83.8
Inheritance Test4.07.13.43.83.75.4
Indexing Test4.69.74.55.54.67.6
Graph (Binary Tree) Test1.55.11.64.31.64.7
Multithreading Test5.221.85.210.65.217.0
All Tests3.79.03.24.83.47.0

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