Compare with

Comparison of OpenJPA with H2 embedded vs DataNucleus with Derby 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
 OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test17.12.85.82.311.52.6
Element Collection Test10.90.714.90.357.90.53
Inheritance Test14.32.75.92.010.12.3
Indexing Test24.44.513.74.019.14.3
Graph (Binary Tree) Test6.80.626.70.536.70.57
Multithreading Test34.24.910.23.422.24.1
All Tests17.92.77.92.112.92.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test14.60.5627.26.320.93.4
Element Collection Test0.00460.364.30.932.10.64
Inheritance Test0.0110.457.46.83.73.6
Indexing Test17.00.5035.07.126.03.8
Graph (Binary Tree) Test1.00.221.46.61.23.4
Multithreading Test18.71.227.610.023.15.6
All Tests8.60.5517.16.312.83.4

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.50) to the normalized speed of OpenJPA with H2 embedded database (17.0) reveals that in that case, OpenJPA with H2 embedded is 34.0 times faster than DataNucleus with Derby server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test5.037.71.13.63.120.7
Element Collection Test1.725.91.31.41.513.6
Inheritance Test2.26.51.21.81.74.2
Indexing Test13.80.03023.24.918.52.5
Multithreading Test1.4failed0.60failed0.99failed
All Tests4.817.55.52.95.110.2

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

The results above show that in general DataNucleus with Derby server 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 database server (10.2) reveals that in these tests, DataNucleus with Derby server is 2.0 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 database server (25.9) reveals that in that case, DataNucleus with Derby server is 15.2 times faster than OpenJPA with H2 embedded.

On the other hand, DataNucleus with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.030) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, DataNucleus with Derby server is 460 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 server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test10.01.16.00.858.00.99
Element Collection Test0.0110.813.80.621.90.71
Inheritance Test0.0461.25.01.32.51.2
Indexing Test8.91.27.01.58.01.3
Graph (Binary Tree) Test2.40.291.30.411.90.35
Multithreading Test16.6failed4.3failed10.4failed
All Tests6.30.934.60.925.40.92

DataNucleus with Derby server 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 server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby database server (0.92) to the normalized speed of OpenJPA with H2 embedded database (5.4) reveals that in these tests, OpenJPA with H2 embedded is 5.9 times faster than DataNucleus with Derby server.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (1.1) to the normalized speed of OpenJPA with H2 embedded database (10.0) reveals that in that case, OpenJPA with H2 embedded is 9.1 times faster than DataNucleus with Derby server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test18.31.311.11.314.71.3
Element Collection Test0.0120.612.90.331.40.47
Inheritance Test0.0301.06.61.33.31.2
Indexing Test23.22.39.71.916.42.1
Graph (Binary Tree) Test1.80.262.40.462.10.36
Multithreading Test31.2failed17.3failed24.2failed
All Tests12.41.18.31.110.41.1

DataNucleus with Derby server 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 server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby database server (1.1) to the normalized speed of OpenJPA with H2 embedded database (10.4) reveals that in these tests, OpenJPA with H2 embedded is 9.5 times faster than DataNucleus with Derby server.

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (1.3) to the normalized speed of OpenJPA with H2 embedded database (18.3) reveals that in that case, OpenJPA with H2 embedded is 14.1 times faster than DataNucleus with Derby server.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
OpenJPA
H2 embedded
DataNucleus
Derby server
Basic Person Test13.08.710.22.911.65.8
Element Collection Test2.55.73.40.723.03.2
Inheritance Test3.32.45.22.64.32.5
Indexing Test17.51.717.73.917.62.8
Graph (Binary Tree) Test3.00.353.02.03.01.2
Multithreading Test20.43.012.06.716.24.9
All Tests10.23.88.82.89.53.3

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

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

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

Other Head to Head DBMS/JPA Comparisons