Compare with

Comparison of DataNucleus with H2 embedded vs OpenJPA 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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test19.213.38.06.913.610.1
Element Collection Test6.68.62.85.34.77.0
Inheritance Test15.612.24.45.810.09.0
Indexing Test24.416.711.89.118.112.9
Graph (Binary Tree) Test9.26.16.27.37.76.7
Multithreading Test34.926.87.17.021.016.9
All Tests18.313.96.76.912.510.4

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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test13.221.813.530.113.325.9
Element Collection Test6.40.00688.94.57.72.2
Inheritance Test12.20.002512.72.012.40.98
Indexing Test8.122.116.543.612.332.9
Graph (Binary Tree) Test10.62.120.92.115.82.1
Multithreading Test13.320.99.923.511.622.2
All Tests10.611.113.717.612.214.4

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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test4.72.81.40.913.11.9
Element Collection Test5.01.42.40.953.71.2
Inheritance Test3.82.41.61.32.71.8
Indexing Test0.004115.41.834.30.9124.9
Multithreading Test1.21.40.790.531.00.95
All Tests3.04.71.67.62.36.1

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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test10.012.03.95.36.98.6
Element Collection Test7.60.0173.93.75.81.8
Inheritance Test9.40.00984.42.06.90.99
Indexing Test10.69.35.95.58.27.4
Graph (Binary Tree) Test5.92.53.71.64.82.1
Multithreading Testfailed20.0failed3.7failed11.8
All Tests8.77.34.43.66.55.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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test4.221.31.315.72.818.5
Element Collection Test4.90.0111.62.93.21.5
Inheritance Test4.00.00701.33.52.71.8
Indexing Test7.528.81.915.24.722.0
Graph (Binary Tree) Test5.62.94.13.64.83.2
Multithreading Testfailed26.0failed19.6failed22.8
All Tests5.213.22.010.13.611.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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test27.041.427.041.427.041.4
Element Collection Test22.446.922.446.922.446.9
Inheritance Test27.041.427.041.427.041.4
Indexing Test31.648.432.149.231.948.8
Graph (Binary Tree) Test20.028.515.021.417.525.0
Multithreading Test33.951.99.210.321.531.1
All Tests27.043.122.135.124.639.1

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
 DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
DataNucleus
H2 embedded
OpenJPA
HSQLDB embedded
Basic Person Test10.314.35.611.87.913.0
Element Collection Test6.12.03.93.55.02.7
Inheritance Test9.02.94.92.96.92.9
Indexing Test10.118.57.621.68.920.0
Graph (Binary Tree) Test7.83.48.73.78.33.5
Multithreading Test16.519.05.910.911.214.9
All Tests9.610.26.09.27.89.7

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