Compare with

Comparison of OpenJPA with HSQLDB embedded vs OpenJPA with MySQL 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
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test13.33.96.91.610.12.7
Element Collection Test8.61.65.30.687.01.1
Inheritance Test12.23.65.81.49.02.5
Indexing Test16.75.69.12.412.94.0
Graph (Binary Tree) Test6.10.687.30.576.70.63
Multithreading Test26.87.27.02.716.94.9
All Tests13.93.76.91.510.42.6

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test21.83.230.122.725.912.9
Element Collection Test0.00680.00384.52.92.21.4
Inheritance Test0.00250.0172.06.90.983.4
Indexing Test22.12.443.623.432.912.9
Graph (Binary Tree) Test2.10.272.10.352.10.31
Multithreading Test20.90.1423.518.122.29.1
All Tests11.11.017.612.414.46.7

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.14) to the normalized speed of OpenJPA with HSQLDB embedded database (20.9) reveals that in that case, OpenJPA with HSQLDB embedded is 149 times faster than OpenJPA with MySQL 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 MySQL database server (0.017) reveals that in that case, OpenJPA with HSQLDB embedded is 6.8 times slower than OpenJPA with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test2.89.30.912.21.95.8
Element Collection Test1.44.80.951.11.22.9
Inheritance Test2.41.51.30.901.81.2
Indexing Test15.40.3134.32.124.91.2
Multithreading Test1.41.90.530.990.951.4
All Tests4.73.67.61.56.12.5

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.31) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with HSQLDB embedded is 49.7 times faster than OpenJPA with MySQL server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of OpenJPA with MySQL database server (4.8) reveals that in that case, OpenJPA with HSQLDB embedded is 3.4 times slower than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test12.00.745.31.68.61.2
Element Collection Test0.0170.0143.71.71.80.87
Inheritance Test0.00980.0482.02.00.991.0
Indexing Test9.30.745.53.07.41.9
Graph (Binary Tree) Test2.50.451.60.252.10.35
Multithreading Test20.00.553.72.911.81.7
All Tests7.30.423.61.95.51.2

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.55) to the normalized speed of OpenJPA with HSQLDB embedded database (20.0) reveals that in that case, OpenJPA with HSQLDB embedded is 36.4 times faster than OpenJPA with MySQL 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 MySQL database server (0.048) reveals that in that case, OpenJPA with HSQLDB embedded is 4.9 times slower than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test21.30.9815.71.718.51.4
Element Collection Test0.0110.00992.90.651.50.33
Inheritance Test0.00700.0333.51.51.80.75
Indexing Test28.80.6415.22.022.01.3
Graph (Binary Tree) Test2.90.413.60.433.20.42
Multithreading Test26.00.2719.62.922.81.6
All Tests13.20.3910.11.511.60.96

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.27) to the normalized speed of OpenJPA with HSQLDB embedded database (26.0) reveals that in that case, OpenJPA with HSQLDB embedded is 96.3 times faster than OpenJPA with MySQL 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 MySQL database server (0.033) reveals that in that case, OpenJPA with HSQLDB embedded is 4.7 times slower than OpenJPA with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
OpenJPA
HSQLDB embedded
OpenJPA
MySQL server
Basic Person Test14.33.611.86.013.04.8
Element Collection Test2.01.33.51.42.71.3
Inheritance Test2.91.02.92.52.91.8
Indexing Test18.51.921.66.620.04.3
Graph (Binary Tree) Test3.40.453.70.403.50.43
Multithreading Test19.02.010.95.514.93.8
All Tests10.21.89.23.99.72.8

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

A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (1.9) to the normalized speed of OpenJPA with HSQLDB embedded database (18.5) reveals that in that case, OpenJPA with HSQLDB embedded is 9.7 times faster than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons