Compare with

Comparison of OpenJPA with H2 server vs OpenJPA 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 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test3.74.82.22.92.93.9
Element Collection Test2.62.81.51.92.12.4
Inheritance Test4.54.12.02.43.23.3
Indexing Test7.36.13.64.15.45.1
Graph (Binary Tree) Test1.11.50.841.40.971.4
Multithreading Test7.78.74.23.35.96.0
All Tests4.54.72.42.73.43.7

The results above show that in general OpenJPA 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
 OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test2.914.87.622.65.218.7
Element Collection Test0.00220.00311.92.30.931.2
Inheritance Test0.0130.0154.07.02.03.5
Indexing Test4.111.78.826.56.519.1
Graph (Binary Tree) Test0.380.930.491.20.441.1
Multithreading Test5.925.214.028.610.026.9
All Tests2.28.86.114.74.211.7

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

A large performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (2.9) to the normalized speed of OpenJPA with Derby embedded database (14.8) reveals that in that case, OpenJPA with Derby embedded is 5.1 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
 OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test3.749.71.09.92.429.8
Element Collection Test2.02.71.29.61.66.1
Inheritance Test2.82.31.11.32.01.8
Indexing Test3.87.07.517.15.712.1
Multithreading Test0.9840.91.011.71.026.3
All Tests2.720.52.49.92.515.2

The results above show that in general OpenJPA 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 OpenJPA with Derby embedded database (15.2) reveals that in these tests, OpenJPA with Derby embedded is 6.1 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 embedded database (40.9) reveals that in that case, OpenJPA with Derby embedded is 41.7 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
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test3.05.62.05.22.55.4
Element Collection Test0.00780.00901.92.20.941.1
Inheritance Test0.0340.0452.84.61.42.3
Indexing Test2.86.13.28.73.07.4
Graph (Binary Tree) Test0.791.60.430.910.611.3
Multithreading Test7.018.32.54.54.811.4
All Tests2.35.32.14.42.24.8

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

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 embedded database (8.7) reveals that in that case, OpenJPA with Derby embedded is 2.7 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
 OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test3.24.22.24.52.74.3
Element Collection Test0.00600.00710.881.60.440.80
Inheritance Test0.0300.0353.13.01.61.5
Indexing Test6.55.33.63.65.14.4
Graph (Binary Tree) Test0.730.800.750.930.740.86
Multithreading Test7.65.75.26.26.46.0
All Tests3.02.72.63.32.83.0

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
OpenJPA
H2 server
OpenJPA
Derby embedded
Basic Person Test3.315.83.09.03.112.4
Element Collection Test0.931.11.53.51.22.3
Inheritance Test1.51.32.63.72.02.5
Indexing Test4.97.25.412.05.19.6
Graph (Binary Tree) Test0.751.20.631.10.691.2
Multithreading Test5.919.85.410.95.615.3
All Tests2.98.03.26.93.07.4

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

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 embedded database (15.8) reveals that in that case, OpenJPA with Derby embedded is 4.8 times faster than OpenJPA with H2 server.

Other Head to Head DBMS/JPA Comparisons