Compare with

Comparison of OpenJPA with HSQLDB embedded 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
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test13.34.86.92.910.13.9
Element Collection Test8.62.85.31.97.02.4
Inheritance Test12.24.15.82.49.03.3
Indexing Test16.76.19.14.112.95.1
Graph (Binary Tree) Test6.11.57.31.46.71.4
Multithreading Test26.88.77.03.316.96.0
All Tests13.94.76.92.710.43.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test21.814.830.122.625.918.7
Element Collection Test0.00680.00314.52.32.21.2
Inheritance Test0.00250.0152.07.00.983.5
Indexing Test22.111.743.626.532.919.1
Graph (Binary Tree) Test2.10.932.11.22.11.1
Multithreading Test20.925.223.528.622.226.9
All Tests11.18.817.614.714.411.7

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

A large performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.93) to the normalized speed of OpenJPA with HSQLDB embedded database (2.1) reveals that in that case, OpenJPA with HSQLDB embedded is 2.3 times faster than OpenJPA with Derby embedded.

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 embedded database (0.015) reveals that in that case, OpenJPA with HSQLDB embedded is 6.0 times slower than OpenJPA with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test2.849.70.919.91.929.8
Element Collection Test1.42.70.959.61.26.1
Inheritance Test2.42.31.31.31.81.8
Indexing Test15.47.034.317.124.912.1
Multithreading Test1.440.90.5311.70.9526.3
All Tests4.720.57.69.96.115.2

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

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 embedded database (40.9) reveals that in that case, OpenJPA with Derby embedded is 29.2 times faster than OpenJPA with HSQLDB embedded.

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (7.0) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with Derby embedded is 2.2 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 embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test12.05.65.35.28.65.4
Element Collection Test0.0170.00903.72.21.81.1
Inheritance Test0.00980.0452.04.60.992.3
Indexing Test9.36.15.58.77.47.4
Graph (Binary Tree) Test2.51.61.60.912.11.3
Multithreading Test20.018.33.74.511.811.4
All Tests7.35.33.64.45.54.8

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

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (5.6) to the normalized speed of OpenJPA with HSQLDB embedded database (12.0) reveals that in that case, OpenJPA with HSQLDB embedded is 2.1 times faster than OpenJPA with Derby embedded.

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 embedded database (0.045) reveals that in that case, OpenJPA with HSQLDB embedded is 4.6 times slower than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test21.34.215.74.518.54.3
Element Collection Test0.0110.00712.91.61.50.80
Inheritance Test0.00700.0353.53.01.81.5
Indexing Test28.85.315.23.622.04.4
Graph (Binary Tree) Test2.90.803.60.933.20.86
Multithreading Test26.05.719.66.222.86.0
All Tests13.22.710.13.311.63.0

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

A large performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (5.3) to the normalized speed of OpenJPA with HSQLDB embedded database (28.8) reveals that in that case, OpenJPA with HSQLDB embedded is 5.4 times faster than OpenJPA with Derby embedded.

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 embedded database (0.035) reveals that in that case, OpenJPA with HSQLDB embedded is 5.0 times slower than OpenJPA with Derby embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test41.452.841.452.841.452.8
Element Collection Test46.942.446.942.446.942.4
Inheritance Test41.444.241.444.241.444.2
Indexing Test48.453.149.254.048.853.5
Graph (Binary Tree) Test28.512.821.49.625.011.2
Multithreading Test51.950.710.39.731.130.2
All Tests43.142.735.135.539.139.1

The results above show that in general OpenJPA with HSQLDB embedded is equivalent to OpenJPA with Derby embedded in using disk space.

A large gap has been detected when using graphs of objects with large transaction size. Comparing the normalized score of OpenJPA with Derby embedded database (9.6) to the normalized score of OpenJPA with HSQLDB embedded database (21.4) reveals that in that case, OpenJPA with HSQLDB embedded is 2.2 times more efficient than OpenJPA with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
OpenJPA
HSQLDB embedded
OpenJPA
Derby embedded
Basic Person Test14.315.811.89.013.012.4
Element Collection Test2.01.13.53.52.72.3
Inheritance Test2.91.32.93.72.92.5
Indexing Test18.57.221.612.020.09.6
Graph (Binary Tree) Test3.41.23.71.13.51.2
Multithreading Test19.019.810.910.914.915.3
All Tests10.28.09.26.99.77.4

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

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (1.1) to the normalized speed of OpenJPA with HSQLDB embedded database (3.7) reveals that in that case, OpenJPA with HSQLDB embedded is 3.4 times faster than OpenJPA with Derby embedded.

Other Head to Head DBMS/JPA Comparisons