Compare with

Comparison of OpenJPA with Derby server 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
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test3.119.22.78.02.913.6
Element Collection Test2.06.61.72.81.84.7
Inheritance Test3.015.62.34.42.610.0
Indexing Test4.724.44.111.84.418.1
Graph (Binary Tree) Test0.719.20.646.20.677.7
Multithreading Test6.034.93.87.14.921.0
All Tests3.318.32.56.72.912.5

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
 OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test0.7813.211.613.56.213.3
Element Collection Test0.00246.41.18.90.547.7
Inheritance Test0.01412.25.012.72.512.4
Indexing Test0.628.113.016.56.812.3
Graph (Binary Tree) Test0.06510.60.3920.90.2315.8
Multithreading Test1.613.319.09.910.311.6
All Tests0.5110.68.413.74.412.2

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
 OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test29.24.75.51.417.33.1
Element Collection Test2.25.01.42.41.83.7
Inheritance Test2.23.81.01.61.62.7
Indexing Test2.20.004111.71.87.00.91
Multithreading Test35.51.28.30.7921.91.0
All Tests14.33.05.61.69.92.3

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
 OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test1.510.04.03.92.86.9
Element Collection Test0.00817.61.93.90.945.8
Inheritance Test0.0439.43.84.41.96.9
Indexing Test1.810.66.85.94.38.2
Graph (Binary Tree) Test0.165.90.273.70.224.8
Multithreading Test6.9failed5.0failed5.9failed
All Tests1.78.73.64.42.76.5

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
 OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test1.44.23.71.32.52.8
Element Collection Test0.00824.91.41.60.713.2
Inheritance Test0.0354.02.51.31.32.7
Indexing Test2.37.53.51.92.94.7
Graph (Binary Tree) Test0.135.60.354.10.244.8
Multithreading Test3.6failed4.0failed3.8failed
All Tests1.35.22.62.01.93.6

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
 OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
OpenJPA
Derby server
DataNucleus
H2 embedded
Basic Person Test7.210.35.55.66.47.9
Element Collection Test0.846.11.53.91.25.0
Inheritance Test1.19.02.94.92.06.9
Indexing Test2.310.17.87.65.18.9
Graph (Binary Tree) Test0.277.80.418.70.348.3
Multithreading Test10.716.58.05.99.411.2
All Tests3.99.64.56.04.27.8

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