Compare with

Comparison of OpenJPA with H2 embedded vs DataNucleus 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
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test17.14.65.82.811.53.7
Element Collection Test10.92.44.91.67.92.0
Inheritance Test14.34.65.92.710.13.7
Indexing Test24.47.613.74.819.16.2
Graph (Binary Tree) Test6.81.66.71.46.71.5
Multithreading Test34.28.610.23.322.25.9
All Tests17.94.97.92.812.93.8

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test14.66.827.214.920.910.9
Element Collection Test0.00465.44.37.62.16.5
Inheritance Test0.0118.87.414.83.711.8
Indexing Test17.09.235.014.126.011.6
Graph (Binary Tree) Test1.09.91.415.81.212.9
Multithreading Test18.711.927.611.523.111.7
All Tests8.68.717.113.112.810.9

The results above show that in general OpenJPA with H2 embedded is slightly more efficient than DataNucleus with Derby 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 Derby embedded database (14.1) to the normalized speed of OpenJPA with H2 embedded database (35.0) reveals that in that case, OpenJPA with H2 embedded is 2.5 times faster than DataNucleus with Derby 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 Derby embedded database (5.4) reveals that in that case, OpenJPA with H2 embedded is 1,174 times slower than DataNucleus with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test5.039.11.17.53.123.3
Element Collection Test1.746.01.36.71.526.3
Inheritance Test2.27.71.23.81.75.7
Indexing Test13.80.05323.28.018.54.0
Multithreading Test1.4failed0.60failed0.99failed
All Tests4.823.25.56.55.114.8

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

The results above show that in general DataNucleus with Derby embedded is more efficient than OpenJPA with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 embedded database (5.1) to the normalized speed of DataNucleus with Derby embedded database (14.8) reveals that in these tests, DataNucleus with Derby embedded is 2.9 times faster than OpenJPA with H2 embedded.

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

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (0.053) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, DataNucleus with Derby embedded is 260 times slower than OpenJPA with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test10.04.06.03.88.03.9
Element Collection Test0.0113.73.84.51.94.1
Inheritance Test0.0464.45.04.82.54.6
Indexing Test8.95.27.04.28.04.7
Graph (Binary Tree) Test2.42.71.31.51.92.1
Multithreading Test16.6failed4.3failed10.4failed
All Tests6.34.04.63.75.43.9

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

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

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (4.0) to the normalized speed of OpenJPA with H2 embedded database (10.0) reveals that in that case, OpenJPA with H2 embedded is 2.5 times faster than DataNucleus with Derby 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.011) to the normalized speed of DataNucleus with Derby embedded database (3.7) reveals that in that case, OpenJPA with H2 embedded is 336 times slower than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test18.33.511.11.314.72.4
Element Collection Test0.0121.92.91.61.41.7
Inheritance Test0.0302.46.61.33.31.9
Indexing Test23.26.69.71.916.44.3
Graph (Binary Tree) Test1.80.812.40.932.10.87
Multithreading Test31.2failed17.3failed24.2failed
All Tests12.43.08.31.410.42.2

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

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

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with Derby 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 Derby 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 Derby embedded database (1.9) reveals that in that case, OpenJPA with H2 embedded is 158 times slower than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test27.053.327.053.327.053.3
Element Collection Test30.642.630.642.630.642.6
Inheritance Test27.048.127.048.127.048.1
Indexing Test31.662.332.163.331.962.8
Graph (Binary Tree) Test28.513.621.410.224.911.9
Multithreading Test33.952.09.28.021.530.0
All Tests29.845.324.537.627.241.5

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

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized score of DataNucleus with Derby embedded database (10.2) to the normalized score of OpenJPA with H2 embedded database (21.4) reveals that in that case, DataNucleus with Derby embedded is 2.1 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
 OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
OpenJPA
H2 embedded
DataNucleus
Derby embedded
Basic Person Test13.011.610.26.111.68.8
Element Collection Test2.511.93.44.43.08.1
Inheritance Test3.35.65.25.54.35.5
Indexing Test17.55.717.76.617.66.2
Graph (Binary Tree) Test3.03.73.04.93.04.3
Multithreading Test20.410.312.07.416.28.8
All Tests10.28.08.85.79.56.9

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

A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (5.7) to the normalized speed of OpenJPA with H2 embedded database (17.5) reveals that in that case, OpenJPA with H2 embedded is 3.1 times faster than DataNucleus with Derby embedded.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (2.5) to the normalized speed of DataNucleus with Derby embedded database (11.9) reveals that in that case, OpenJPA with H2 embedded is 4.8 times slower than DataNucleus with Derby embedded.

Other Head to Head DBMS/JPA Comparisons