Compare with

Comparison of DataNucleus with H2 embedded vs OpenJPA with Derby server

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
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test19.23.18.02.713.62.9
Element Collection Test6.62.02.81.74.71.8
Inheritance Test15.63.04.42.310.02.6
Indexing Test24.44.711.84.118.14.4
Graph (Binary Tree) Test9.20.716.20.647.70.67
Multithreading Test34.96.07.13.821.04.9
All Tests18.33.36.72.512.52.9

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

A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.71) to the normalized speed of DataNucleus with H2 embedded database (9.2) reveals that in that case, DataNucleus with H2 embedded is 13.0 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test13.20.7813.511.613.36.2
Element Collection Test6.40.00248.91.17.70.54
Inheritance Test12.20.01412.75.012.42.5
Indexing Test8.10.6216.513.012.36.8
Graph (Binary Tree) Test10.60.06520.90.3915.80.23
Multithreading Test13.31.69.919.011.610.3
All Tests10.60.5113.78.412.24.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test4.729.21.45.53.117.3
Element Collection Test5.02.22.41.43.71.8
Inheritance Test3.82.21.61.02.71.6
Indexing Test0.00412.21.811.70.917.0
Multithreading Test1.235.50.798.31.021.9
All Tests3.014.31.65.62.39.9

The results above show that in general OpenJPA with Derby server is much 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 Derby database server (9.9) reveals that in these tests, OpenJPA with Derby server is 4.3 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 Derby database server (2.2) reveals that in that case, OpenJPA with Derby server is 537 times faster than DataNucleus with H2 embedded.

On the other hand, OpenJPA with Derby server is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (2.2) to the normalized speed of DataNucleus with H2 embedded database (5.0) reveals that in that case, OpenJPA with Derby server is 2.3 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
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test10.01.53.94.06.92.8
Element Collection Test7.60.00813.91.95.80.94
Inheritance Test9.40.0434.43.86.91.9
Indexing Test10.61.85.96.88.24.3
Graph (Binary Tree) Test5.90.163.70.274.80.22
Multithreading Testfailed6.9failed5.0failed5.9
All Tests8.71.74.43.66.52.7

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

The results above show that in general DataNucleus with H2 embedded is more efficient than OpenJPA with Derby server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with Derby database server (2.7) to the normalized speed of DataNucleus with H2 embedded database (6.5) reveals that in these tests, DataNucleus with H2 embedded is 2.4 times faster than OpenJPA with Derby server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test4.21.41.33.72.82.5
Element Collection Test4.90.00821.61.43.20.71
Inheritance Test4.00.0351.32.52.71.3
Indexing Test7.52.31.93.54.72.9
Graph (Binary Tree) Test5.60.134.10.354.80.24
Multithreading Testfailed3.6failed4.0failed3.8
All Tests5.21.32.02.63.61.9

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

The results above show that in general DataNucleus with H2 embedded is more efficient than OpenJPA with Derby server in deleting JPA entity objects from 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 Derby database server (0.0082) to the normalized speed of DataNucleus with H2 embedded database (4.9) reveals that in that case, DataNucleus with H2 embedded is 598 times faster than OpenJPA with Derby server.

On the other hand, DataNucleus with H2 embedded is slower, for instance, 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 Derby database server (3.7) reveals that in that case, DataNucleus with H2 embedded is 2.8 times slower than OpenJPA with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
Basic Person Test10.37.25.65.57.96.4
Element Collection Test6.10.843.91.55.01.2
Inheritance Test9.01.14.92.96.92.0
Indexing Test10.12.37.67.88.95.1
Graph (Binary Tree) Test7.80.278.70.418.30.34
Multithreading Test16.510.75.98.011.29.4
All Tests9.63.96.04.57.84.2

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

A huge performance gap has been detected when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.27) to the normalized speed of DataNucleus with H2 embedded database (7.8) reveals that in that case, DataNucleus with H2 embedded is 28.9 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons