Compare with

Comparison of OpenJPA with HSQLDB embedded vs DataNucleus with H2 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
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test13.319.26.98.010.113.6
Element Collection Test8.66.65.32.87.04.7
Inheritance Test12.215.65.84.49.010.0
Indexing Test16.724.49.111.812.918.1
Graph (Binary Tree) Test6.19.27.36.26.77.7
Multithreading Test26.834.97.07.116.921.0
All Tests13.918.36.96.710.412.5

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test21.813.230.113.525.913.3
Element Collection Test0.00686.44.58.92.27.7
Inheritance Test0.002512.22.012.70.9812.4
Indexing Test22.18.143.616.532.912.3
Graph (Binary Tree) Test2.110.62.120.92.115.8
Multithreading Test20.913.323.59.922.211.6
All Tests11.110.617.613.714.412.2

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

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test2.84.70.911.41.93.1
Element Collection Test1.45.00.952.41.23.7
Inheritance Test2.43.81.31.61.82.7
Indexing Test15.40.004134.31.824.90.91
Multithreading Test1.41.20.530.790.951.0
All Tests4.73.07.61.66.12.3

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than DataNucleus with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 embedded database (2.3) to the normalized speed of OpenJPA with HSQLDB embedded database (6.1) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.7 times faster than DataNucleus with H2 embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (0.0041) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with HSQLDB embedded is 3,756 times faster than DataNucleus with H2 embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test12.010.05.33.98.66.9
Element Collection Test0.0177.63.73.91.85.8
Inheritance Test0.00989.42.04.40.996.9
Indexing Test9.310.65.55.97.48.2
Graph (Binary Tree) Test2.55.91.63.72.14.8
Multithreading Test20.0failed3.7failed11.8failed
All Tests7.38.73.64.45.56.5

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

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of DataNucleus with H2 embedded database (9.4) reveals that in that case, DataNucleus with H2 embedded is 959 times faster than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test21.34.215.71.318.52.8
Element Collection Test0.0114.92.91.61.53.2
Inheritance Test0.00704.03.51.31.82.7
Indexing Test28.87.515.21.922.04.7
Graph (Binary Tree) Test2.95.63.64.13.24.8
Multithreading Test26.0failed19.6failed22.8failed
All Tests13.25.210.12.011.63.6

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

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test41.427.041.427.041.427.0
Element Collection Test46.922.446.922.446.922.4
Inheritance Test41.427.041.427.041.427.0
Indexing Test48.431.649.232.148.831.9
Graph (Binary Tree) Test28.520.021.415.025.017.5
Multithreading Test51.933.910.39.231.121.5
All Tests43.127.035.122.139.124.6

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

A large gap has been detected when using JPA element collections with small transaction size. Comparing the normalized score of DataNucleus with H2 embedded database (22.4) to the normalized score of OpenJPA with HSQLDB embedded database (46.9) reveals that in that case, OpenJPA with HSQLDB embedded is 2.1 times more efficient than DataNucleus with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
Basic Person Test14.310.311.85.613.07.9
Element Collection Test2.06.13.53.92.75.0
Inheritance Test2.99.02.94.92.96.9
Indexing Test18.510.121.67.620.08.9
Graph (Binary Tree) Test3.47.83.78.73.58.3
Multithreading Test19.016.510.95.914.911.2
All Tests10.29.69.26.09.77.8

The results above show that in general OpenJPA with HSQLDB embedded is slightly more efficient than DataNucleus with H2 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 H2 embedded database (7.6) to the normalized speed of OpenJPA with HSQLDB embedded database (21.6) reveals that in that case, OpenJPA with HSQLDB embedded is 2.8 times faster than DataNucleus with H2 embedded.

On the other hand, OpenJPA with HSQLDB 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 HSQLDB embedded database (2.9) to the normalized speed of DataNucleus with H2 embedded database (9.0) reveals that in that case, OpenJPA with HSQLDB embedded is 3.1 times slower than DataNucleus with H2 embedded.

Other Head to Head DBMS/JPA Comparisons