Compare with

Comparison of DataNucleus with HSQLDB embedded vs OpenJPA 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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test14.217.14.85.89.511.5
Element Collection Test6.610.92.14.94.37.9
Inheritance Test13.614.34.65.99.110.1
Indexing Test24.624.411.113.717.819.1
Graph (Binary Tree) Test6.86.84.56.75.76.7
Multithreading Test38.534.28.510.223.522.2
All Tests17.417.95.97.911.712.9

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test6.614.610.227.28.420.9
Element Collection Test3.60.00468.14.35.82.1
Inheritance Test5.70.0118.87.47.23.7
Indexing Test5.117.09.535.07.326.0
Graph (Binary Tree) Test7.21.09.31.48.31.2
Multithreading Test8.118.79.527.68.823.1
All Tests6.08.69.217.17.612.8

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test1.45.00.481.10.953.1
Element Collection Test1.31.70.671.31.01.5
Inheritance Test1.62.20.611.21.11.7
Indexing Test0.001613.80.6323.20.3218.5
Multithreading Test0.401.4failed0.600.400.99
All Tests0.964.80.605.50.805.1

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test11.510.02.76.07.18.0
Element Collection Test6.90.0112.73.84.81.9
Inheritance Test10.30.0463.65.06.92.5
Indexing Test11.48.94.47.07.98.0
Graph (Binary Tree) Test3.52.41.51.32.51.9
Multithreading Testfailed16.6failed4.3failed10.4
All Tests8.76.33.04.65.85.4

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test4.218.31.311.12.814.7
Element Collection Test4.90.0121.62.93.21.4
Inheritance Test4.00.0301.36.62.73.3
Indexing Test7.523.21.99.74.716.4
Graph (Binary Tree) Test2.91.82.02.42.52.1
Multithreading Test40.131.213.717.326.924.2
All Tests10.612.43.78.37.110.4

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test41.427.041.427.041.427.0
Element Collection Test23.430.623.430.623.430.6
Inheritance Test41.427.041.427.041.427.0
Indexing Test48.431.649.232.148.831.9
Graph (Binary Tree) Test12.528.59.421.410.924.9
Multithreading Test51.933.910.39.231.121.5
All Tests36.529.829.224.532.927.2

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
 DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
DataNucleus
HSQLDB embedded
OpenJPA
H2 embedded
Basic Person Test7.613.03.910.25.711.6
Element Collection Test4.72.53.03.43.83.0
Inheritance Test7.13.33.85.25.44.3
Indexing Test9.717.55.517.77.617.6
Graph (Binary Tree) Test5.13.04.33.04.73.0
Multithreading Test21.820.410.612.017.016.2
All Tests9.010.24.88.87.09.5

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