Compare with

Comparison of OpenJPA with Derby embedded 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 embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test4.819.22.98.03.913.6
Element Collection Test2.86.61.92.82.44.7
Inheritance Test4.115.62.44.43.310.0
Indexing Test6.124.44.111.85.118.1
Graph (Binary Tree) Test1.59.21.46.21.47.7
Multithreading Test8.734.93.37.16.021.0
All Tests4.718.32.76.73.712.5

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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test14.813.222.613.518.713.3
Element Collection Test0.00316.42.38.91.27.7
Inheritance Test0.01512.27.012.73.512.4
Indexing Test11.78.126.516.519.112.3
Graph (Binary Tree) Test0.9310.61.220.91.115.8
Multithreading Test25.213.328.69.926.911.6
All Tests8.810.614.713.711.712.2

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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test49.74.79.91.429.83.1
Element Collection Test2.75.09.62.46.13.7
Inheritance Test2.33.81.31.61.82.7
Indexing Test7.00.004117.11.812.10.91
Multithreading Test40.91.211.70.7926.31.0
All Tests20.53.09.91.615.22.3

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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test5.610.05.23.95.46.9
Element Collection Test0.00907.62.23.91.15.8
Inheritance Test0.0459.44.64.42.36.9
Indexing Test6.110.68.75.97.48.2
Graph (Binary Tree) Test1.65.90.913.71.34.8
Multithreading Test18.3failed4.5failed11.4failed
All Tests5.38.74.44.44.86.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 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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test4.24.24.51.34.32.8
Element Collection Test0.00714.91.61.60.803.2
Inheritance Test0.0354.03.01.31.52.7
Indexing Test5.37.53.61.94.44.7
Graph (Binary Tree) Test0.805.60.934.10.864.8
Multithreading Test5.7failed6.2failed6.0failed
All Tests2.75.23.32.03.03.6

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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test52.827.052.827.052.827.0
Element Collection Test42.422.442.422.442.422.4
Inheritance Test44.227.044.227.044.227.0
Indexing Test53.131.654.032.153.531.9
Graph (Binary Tree) Test12.820.09.615.011.217.5
Multithreading Test50.733.99.79.230.221.5
All Tests42.727.035.522.139.124.6

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
 OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
OpenJPA
Derby embedded
DataNucleus
H2 embedded
Basic Person Test15.810.39.05.612.47.9
Element Collection Test1.16.13.53.92.35.0
Inheritance Test1.39.03.74.92.56.9
Indexing Test7.210.112.07.69.68.9
Graph (Binary Tree) Test1.27.81.18.71.28.3
Multithreading Test19.816.510.95.915.311.2
All Tests8.09.66.96.07.47.8

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