Compare with

Comparison of OpenJPA with Derby server 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
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test3.13.72.72.22.92.9
Element Collection Test2.02.61.71.51.82.1
Inheritance Test3.04.52.32.02.63.2
Indexing Test4.77.34.13.64.45.4
Graph (Binary Tree) Test0.711.10.640.840.670.97
Multithreading Test6.07.73.84.24.95.9
All Tests3.34.52.52.42.93.4

The results above show that in general OpenJPA with H2 server is slightly more efficient than OpenJPA with Derby 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
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test0.782.911.67.66.25.2
Element Collection Test0.00240.00221.11.90.540.93
Inheritance Test0.0140.0135.04.02.52.0
Indexing Test0.624.113.08.86.86.5
Graph (Binary Tree) Test0.0650.380.390.490.230.44
Multithreading Test1.65.919.014.010.310.0
All Tests0.512.28.46.14.44.2

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

On the other hand, OpenJPA with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.62) to the normalized speed of OpenJPA with H2 database server (4.1) reveals that in that case, OpenJPA with Derby server is 6.6 times slower than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test29.23.75.51.017.32.4
Element Collection Test2.22.01.41.21.81.6
Inheritance Test2.22.81.01.11.62.0
Indexing Test2.23.811.77.57.05.7
Multithreading Test35.50.988.31.021.91.0
All Tests14.32.75.62.49.92.5

The results above show that in general OpenJPA with Derby server 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 OpenJPA with Derby database server (9.9) reveals that in these tests, OpenJPA with Derby server is 4.0 times faster than OpenJPA with H2 server.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.98) to the normalized speed of OpenJPA with Derby database server (35.5) reveals that in that case, OpenJPA with Derby server is 36.2 times faster than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test1.53.04.02.02.82.5
Element Collection Test0.00810.00781.91.90.940.94
Inheritance Test0.0430.0343.82.81.91.4
Indexing Test1.82.86.83.24.33.0
Graph (Binary Tree) Test0.160.790.270.430.220.61
Multithreading Test6.97.05.02.55.94.8
All Tests1.72.33.62.12.72.2

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

A large performance gap has been detected when using database indexes with large transaction size. Comparing the normalized speed of OpenJPA with H2 database server (3.2) to the normalized speed of OpenJPA with Derby database server (6.8) reveals that in that case, OpenJPA with Derby server is 2.1 times faster than OpenJPA with H2 server.

On the other hand, OpenJPA with Derby server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.16) to the normalized speed of OpenJPA with H2 database server (0.79) reveals that in that case, OpenJPA with Derby server is 4.9 times slower than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test1.43.23.72.22.52.7
Element Collection Test0.00820.00601.40.880.710.44
Inheritance Test0.0350.0302.53.11.31.6
Indexing Test2.36.53.53.62.95.1
Graph (Binary Tree) Test0.130.730.350.750.240.74
Multithreading Test3.67.64.05.23.86.4
All Tests1.33.02.62.61.92.8

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
OpenJPA
Derby server
OpenJPA
H2 server
Basic Person Test7.23.35.53.06.43.1
Element Collection Test0.840.931.51.51.21.2
Inheritance Test1.11.52.92.62.02.0
Indexing Test2.34.97.85.45.15.1
Graph (Binary Tree) Test0.270.750.410.630.340.69
Multithreading Test10.75.98.05.49.45.6
All Tests3.92.94.53.24.23.0

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

A large performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (3.3) to the normalized speed of OpenJPA with Derby database server (7.2) reveals that in that case, OpenJPA with Derby server is 2.2 times faster than OpenJPA with H2 server.

On the other hand, OpenJPA with Derby server is slower, for instance, when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby database server (0.27) to the normalized speed of OpenJPA with H2 database server (0.75) reveals that in that case, OpenJPA with Derby server is 2.8 times slower than OpenJPA with H2 server.

Other Head to Head DBMS/JPA Comparisons