Compare with

Comparison of DataNucleus with H2 embedded vs OpenJPA with Derby 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
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test19.24.88.02.913.63.9
Element Collection Test6.62.82.81.94.72.4
Inheritance Test15.64.14.42.410.03.3
Indexing Test24.46.111.84.118.15.1
Graph (Binary Tree) Test9.21.56.21.47.71.4
Multithreading Test34.98.77.13.321.06.0
All Tests18.34.76.72.712.53.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test13.214.813.522.613.318.7
Element Collection Test6.40.00318.92.37.71.2
Inheritance Test12.20.01512.77.012.43.5
Indexing Test8.111.716.526.512.319.1
Graph (Binary Tree) Test10.60.9320.91.215.81.1
Multithreading Test13.325.29.928.611.626.9
All Tests10.68.813.714.712.211.7

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

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

On the other hand, DataNucleus with H2 embedded is slower, for instance, when using multithreading with large retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (9.9) to the normalized speed of OpenJPA with Derby embedded database (28.6) reveals that in that case, DataNucleus with H2 embedded is 2.9 times slower than OpenJPA with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test4.749.71.49.93.129.8
Element Collection Test5.02.72.49.63.76.1
Inheritance Test3.82.31.61.32.71.8
Indexing Test0.00417.01.817.10.9112.1
Multithreading Test1.240.90.7911.71.026.3
All Tests3.020.51.69.92.315.2

The results above show that in general OpenJPA with Derby embedded 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 embedded database (15.2) reveals that in these tests, OpenJPA with Derby embedded is 6.6 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 embedded database (7.0) reveals that in that case, OpenJPA with Derby embedded is 1,707 times faster 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 embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test10.05.63.95.26.95.4
Element Collection Test7.60.00903.92.25.81.1
Inheritance Test9.40.0454.44.66.92.3
Indexing Test10.66.15.98.78.27.4
Graph (Binary Tree) Test5.91.63.70.914.81.3
Multithreading Testfailed18.3failed4.5failed11.4
All Tests8.75.34.44.46.54.8

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 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 Derby embedded database (0.0090) to the normalized speed of DataNucleus with H2 embedded database (7.6) reveals that in that case, DataNucleus with H2 embedded is 844 times faster than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test4.24.21.34.52.84.3
Element Collection Test4.90.00711.61.63.20.80
Inheritance Test4.00.0351.33.02.71.5
Indexing Test7.55.31.93.64.74.4
Graph (Binary Tree) Test5.60.804.10.934.80.86
Multithreading Testfailed5.7failed6.2failed6.0
All Tests5.22.72.03.33.63.0

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 Derby embedded 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 embedded database (0.0071) to the normalized speed of DataNucleus with H2 embedded database (4.9) reveals that in that case, DataNucleus with H2 embedded is 690 times faster than OpenJPA with Derby embedded.

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 embedded database (4.5) reveals that in that case, DataNucleus with H2 embedded is 3.5 times slower than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test27.052.827.052.827.052.8
Element Collection Test22.442.422.442.422.442.4
Inheritance Test27.044.227.044.227.044.2
Indexing Test31.653.132.154.031.953.5
Graph (Binary Tree) Test20.012.815.09.617.511.2
Multithreading Test33.950.79.29.721.530.2
All Tests27.042.722.135.524.639.1

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
Basic Person Test10.315.85.69.07.912.4
Element Collection Test6.11.13.93.55.02.3
Inheritance Test9.01.34.93.76.92.5
Indexing Test10.17.27.612.08.99.6
Graph (Binary Tree) Test7.81.28.71.18.31.2
Multithreading Test16.519.85.910.911.215.3
All Tests9.68.06.06.97.87.4

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

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (1.1) to the normalized speed of DataNucleus with H2 embedded database (8.7) reveals that in that case, DataNucleus with H2 embedded is 7.9 times faster than OpenJPA with Derby embedded.

Other Head to Head DBMS/JPA Comparisons