Compare with

Comparison of OpenJPA with H2 embedded 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 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test17.114.25.84.811.59.5
Element Collection Test10.96.64.92.17.94.3
Inheritance Test14.313.65.94.610.19.1
Indexing Test24.424.613.711.119.117.8
Graph (Binary Tree) Test6.86.86.74.56.75.7
Multithreading Test34.238.510.28.522.223.5
All Tests17.917.47.95.912.911.7

The results above show that in general OpenJPA with H2 embedded is slightly more efficient than DataNucleus with HSQLDB embedded in persisting JPA entity objects to the database.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test14.66.627.210.220.98.4
Element Collection Test0.00463.64.38.12.15.8
Inheritance Test0.0115.77.48.83.77.2
Indexing Test17.05.135.09.526.07.3
Graph (Binary Tree) Test1.07.21.49.31.28.3
Multithreading Test18.78.127.69.523.18.8
All Tests8.66.017.19.212.87.6

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

A large performance gap has been detected when using database indexes with large retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (9.5) to the normalized speed of OpenJPA with H2 embedded database (35.0) reveals that in that case, OpenJPA with H2 embedded is 3.7 times faster than DataNucleus with HSQLDB embedded.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.0046) to the normalized speed of DataNucleus with HSQLDB embedded database (3.6) reveals that in that case, OpenJPA with H2 embedded is 783 times slower than DataNucleus with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test5.01.41.10.483.10.95
Element Collection Test1.71.31.30.671.51.0
Inheritance Test2.21.61.20.611.71.1
Indexing Test13.80.001623.20.6318.50.32
Multithreading Test1.40.400.60failed0.990.40
All Tests4.80.965.50.605.10.80

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

The results above show that in general OpenJPA with H2 embedded 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 embedded database (5.1) reveals that in these tests, OpenJPA with H2 embedded is 6.4 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 embedded database (13.8) reveals that in that case, OpenJPA with H2 embedded is 8,625 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 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test10.011.56.02.78.07.1
Element Collection Test0.0116.93.82.71.94.8
Inheritance Test0.04610.35.03.62.56.9
Indexing Test8.911.47.04.48.07.9
Graph (Binary Tree) Test2.43.51.31.51.92.5
Multithreading Test16.6failed4.3failed10.4failed
All Tests6.38.74.63.05.45.8

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

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

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

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (2.7) to the normalized speed of OpenJPA with H2 embedded database (6.0) reveals that in that case, DataNucleus with HSQLDB embedded is 2.2 times slower than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test18.34.211.11.314.72.8
Element Collection Test0.0124.92.91.61.43.2
Inheritance Test0.0304.06.61.33.32.7
Indexing Test23.27.59.71.916.44.7
Graph (Binary Tree) Test1.82.92.42.02.12.5
Multithreading Test31.240.117.313.724.226.9
All Tests12.410.68.33.710.47.1

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

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of OpenJPA with H2 embedded database (11.1) reveals that in that case, OpenJPA with H2 embedded is 8.5 times faster than DataNucleus with HSQLDB embedded.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.012) to the normalized speed of DataNucleus with HSQLDB embedded database (4.9) reveals that in that case, OpenJPA with H2 embedded is 408 times slower than DataNucleus with HSQLDB embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test27.041.427.041.427.041.4
Element Collection Test30.623.430.623.430.623.4
Inheritance Test27.041.427.041.427.041.4
Indexing Test31.648.432.149.231.948.8
Graph (Binary Tree) Test28.512.521.49.424.910.9
Multithreading Test33.951.99.210.321.531.1
All Tests29.836.524.529.227.232.9

The results above show that in general DataNucleus with HSQLDB embedded is slightly more efficient than OpenJPA with H2 embedded in using disk space.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized score of DataNucleus with HSQLDB embedded database (12.5) to the normalized score of OpenJPA with H2 embedded database (28.5) reveals that in that case, DataNucleus with HSQLDB embedded is 2.3 times less efficient than OpenJPA with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
Basic Person Test13.07.610.23.911.65.7
Element Collection Test2.54.73.43.03.03.8
Inheritance Test3.37.15.23.84.35.4
Indexing Test17.59.717.75.517.67.6
Graph (Binary Tree) Test3.05.13.04.33.04.7
Multithreading Test20.421.812.010.616.217.0
All Tests10.29.08.84.89.57.0

The results above show that in general OpenJPA with H2 embedded is more efficient than DataNucleus with HSQLDB embedded in performing JPA database operations.

A large performance gap has been detected when using database indexes with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (5.5) to the normalized speed of OpenJPA with H2 embedded database (17.7) reveals that in that case, OpenJPA with H2 embedded is 3.2 times faster than DataNucleus with HSQLDB embedded.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (3.3) to the normalized speed of DataNucleus with HSQLDB embedded database (7.1) reveals that in that case, OpenJPA with H2 embedded is 2.2 times slower than DataNucleus with HSQLDB embedded.

Other Head to Head DBMS/JPA Comparisons