Compare with

Comparison of OpenJPA with HSQLDB embedded vs OpenJPA 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
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test13.33.16.92.710.12.9
Element Collection Test8.62.05.31.77.01.8
Inheritance Test12.23.05.82.39.02.6
Indexing Test16.74.79.14.112.94.4
Graph (Binary Tree) Test6.10.717.30.646.70.67
Multithreading Test26.86.07.03.816.94.9
All Tests13.93.36.92.510.42.9

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with Derby database server (0.64) to the normalized speed of OpenJPA with HSQLDB embedded database (7.3) reveals that in that case, OpenJPA with HSQLDB embedded is 11.4 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test21.80.7830.111.625.96.2
Element Collection Test0.00680.00244.51.12.20.54
Inheritance Test0.00250.0142.05.00.982.5
Indexing Test22.10.6243.613.032.96.8
Graph (Binary Tree) Test2.10.0652.10.392.10.23
Multithreading Test20.91.623.519.022.210.3
All Tests11.10.5117.68.414.44.4

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

A huge performance gap has been detected 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 HSQLDB embedded database (22.1) reveals that in that case, OpenJPA with HSQLDB embedded is 35.6 times faster than OpenJPA with Derby server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0025) to the normalized speed of OpenJPA with Derby database server (0.014) reveals that in that case, OpenJPA with HSQLDB embedded is 5.6 times slower than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test2.829.20.915.51.917.3
Element Collection Test1.42.20.951.41.21.8
Inheritance Test2.42.21.31.01.81.6
Indexing Test15.42.234.311.724.97.0
Multithreading Test1.435.50.538.30.9521.9
All Tests4.714.37.65.66.19.9

The results above show that in general OpenJPA with Derby server is more efficient than OpenJPA with HSQLDB embedded in executing the tested JPA queries.

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

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 (2.2) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with Derby server is 7.0 times slower than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test12.01.55.34.08.62.8
Element Collection Test0.0170.00813.71.91.80.94
Inheritance Test0.00980.0432.03.80.991.9
Indexing Test9.31.85.56.87.44.3
Graph (Binary Tree) Test2.50.161.60.272.10.22
Multithreading Test20.06.93.75.011.85.9
All Tests7.31.73.63.65.52.7

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

A huge 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.16) to the normalized speed of OpenJPA with HSQLDB embedded database (2.5) reveals that in that case, OpenJPA with HSQLDB embedded is 15.6 times faster than OpenJPA with Derby server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of OpenJPA with Derby database server (0.043) reveals that in that case, OpenJPA with HSQLDB embedded is 4.4 times slower than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test21.31.415.73.718.52.5
Element Collection Test0.0110.00822.91.41.50.71
Inheritance Test0.00700.0353.52.51.81.3
Indexing Test28.82.315.23.522.02.9
Graph (Binary Tree) Test2.90.133.60.353.20.24
Multithreading Test26.03.619.64.022.83.8
All Tests13.21.310.12.611.61.9

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than OpenJPA with Derby server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with Derby database server (1.9) to the normalized speed of OpenJPA with HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 6.1 times faster than OpenJPA with Derby server.

A huge 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 HSQLDB embedded database (2.9) reveals that in that case, OpenJPA with HSQLDB embedded is 22.3 times faster than OpenJPA with Derby server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0070) to the normalized speed of OpenJPA with Derby database server (0.035) reveals that in that case, OpenJPA with HSQLDB embedded is 5.0 times slower than OpenJPA with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
OpenJPA
HSQLDB embedded
OpenJPA
Derby server
Basic Person Test14.37.211.85.513.06.4
Element Collection Test2.00.843.51.52.71.2
Inheritance Test2.91.12.92.92.92.0
Indexing Test18.52.321.67.820.05.1
Graph (Binary Tree) Test3.40.273.70.413.50.34
Multithreading Test19.010.710.98.014.99.4
All Tests10.23.99.24.59.74.2

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

A huge performance gap has been detected 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 HSQLDB embedded database (3.4) reveals that in that case, OpenJPA with HSQLDB embedded is 12.6 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons