Compare with

Comparison of OpenJPA 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
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.714.22.24.82.99.5
Element Collection Test2.66.61.52.12.14.3
Inheritance Test4.513.62.04.63.29.1
Indexing Test7.324.63.611.15.417.8
Graph (Binary Tree) Test1.16.80.844.50.975.7
Multithreading Test7.738.54.28.55.923.5
All Tests4.517.42.45.93.411.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test2.96.67.610.25.28.4
Element Collection Test0.00223.61.98.10.935.8
Inheritance Test0.0135.74.08.82.07.2
Indexing Test4.15.18.89.56.57.3
Graph (Binary Tree) Test0.387.20.499.30.448.3
Multithreading Test5.98.114.09.510.08.8
All Tests2.26.06.19.24.27.6

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.71.41.00.482.40.95
Element Collection Test2.01.31.20.671.61.0
Inheritance Test2.81.61.10.612.01.1
Indexing Test3.80.00167.50.635.70.32
Multithreading Test0.980.401.0failed1.00.40
All Tests2.70.962.40.602.50.80

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

The results above show that in general OpenJPA with H2 server is much 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 OpenJPA with H2 database server (2.5) reveals that in these tests, OpenJPA with H2 server is 3.1 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 OpenJPA with H2 database server (3.8) reveals that in that case, OpenJPA with H2 server is 2,375 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
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.011.52.02.72.57.1
Element Collection Test0.00786.91.92.70.944.8
Inheritance Test0.03410.32.83.61.46.9
Indexing Test2.811.43.24.43.07.9
Graph (Binary Tree) Test0.793.50.431.50.612.5
Multithreading Test7.0failed2.5failed4.8failed
All Tests2.38.72.13.02.25.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 OpenJPA with H2 server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with H2 database server (2.2) to the normalized speed of DataNucleus with HSQLDB embedded database (5.8) reveals that in these tests, DataNucleus with HSQLDB embedded is 2.6 times faster than OpenJPA with H2 server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0078) to the normalized speed of DataNucleus with HSQLDB embedded database (6.9) reveals that in that case, DataNucleus with HSQLDB embedded is 885 times faster than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.24.22.21.32.72.8
Element Collection Test0.00604.90.881.60.443.2
Inheritance Test0.0304.03.11.31.62.7
Indexing Test6.57.53.61.95.14.7
Graph (Binary Tree) Test0.732.90.752.00.742.5
Multithreading Test7.640.15.213.76.426.9
All Tests3.010.62.63.72.87.1

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0060) to the normalized speed of DataNucleus with HSQLDB embedded database (4.9) reveals that in that case, DataNucleus with HSQLDB embedded is 817 times faster than OpenJPA with H2 server.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of OpenJPA with H2 database server (3.1) reveals that in that case, DataNucleus with HSQLDB embedded is 2.4 times slower than OpenJPA with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
OpenJPA
H2 server
DataNucleus
HSQLDB embedded
Basic Person Test3.37.63.03.93.15.7
Element Collection Test0.934.71.53.01.23.8
Inheritance Test1.57.12.63.82.05.4
Indexing Test4.99.75.45.55.17.6
Graph (Binary Tree) Test0.755.10.634.30.694.7
Multithreading Test5.921.85.410.65.617.0
All Tests2.99.03.24.83.07.0

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

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.63) to the normalized speed of DataNucleus with HSQLDB embedded database (4.3) reveals that in that case, DataNucleus with HSQLDB embedded is 6.8 times faster than OpenJPA with H2 server.

Other Head to Head DBMS/JPA Comparisons