Compare with

Comparison of DataNucleus with Derby embedded vs OpenJPA with H2 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
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test4.63.72.82.23.72.9
Element Collection Test2.42.61.61.52.02.1
Inheritance Test4.64.52.72.03.73.2
Indexing Test7.67.34.83.66.25.4
Graph (Binary Tree) Test1.61.11.40.841.50.97
Multithreading Test8.67.73.34.25.95.9
All Tests4.94.52.82.43.83.4

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test6.82.914.97.610.95.2
Element Collection Test5.40.00227.61.96.50.93
Inheritance Test8.80.01314.84.011.82.0
Indexing Test9.24.114.18.811.66.5
Graph (Binary Tree) Test9.90.3815.80.4912.90.44
Multithreading Test11.95.911.514.011.710.0
All Tests8.72.213.16.110.94.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test39.13.77.51.023.32.4
Element Collection Test46.02.06.71.226.31.6
Inheritance Test7.72.83.81.15.72.0
Indexing Test0.0533.88.07.54.05.7
Multithreading Testfailed0.98failed1.0failed1.0
All Tests23.22.76.52.414.82.5

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

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test4.03.03.82.03.92.5
Element Collection Test3.70.00784.51.94.10.94
Inheritance Test4.40.0344.82.84.61.4
Indexing Test5.22.84.23.24.73.0
Graph (Binary Tree) Test2.70.791.50.432.10.61
Multithreading Testfailed7.0failed2.5failed4.8
All Tests4.02.33.72.13.92.2

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test3.53.21.32.22.42.7
Element Collection Test1.90.00601.60.881.70.44
Inheritance Test2.40.0301.33.11.91.6
Indexing Test6.66.51.93.64.35.1
Graph (Binary Tree) Test0.810.730.930.750.870.74
Multithreading Testfailed7.6failed5.2failed6.4
All Tests3.03.01.42.62.22.8

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

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

A large performance gap has been detected when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.3) to the normalized speed of OpenJPA with H2 database server (3.1) reveals that in that case, OpenJPA with H2 server is 2.4 times faster than DataNucleus with Derby embedded.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
DataNucleus
Derby embedded
OpenJPA
H2 server
Basic Person Test11.63.36.13.08.83.1
Element Collection Test11.90.934.41.58.11.2
Inheritance Test5.61.55.52.65.52.0
Indexing Test5.74.96.65.46.25.1
Graph (Binary Tree) Test3.70.754.90.634.30.69
Multithreading Test10.35.97.45.48.85.6
All Tests8.02.95.73.26.93.0

The results above show that in general DataNucleus with Derby embedded is more efficient than OpenJPA with H2 server in performing JPA database operations. Comparing the normalized speed of OpenJPA with H2 database server (3.0) to the normalized speed of DataNucleus with Derby embedded database (6.9) reveals that in these tests, DataNucleus with Derby embedded is 2.3 times faster than OpenJPA with H2 server.

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

Other Head to Head DBMS/JPA Comparisons