Compare with

Comparison of OpenJPA with Derby 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
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test4.83.92.91.63.92.7
Element Collection Test2.81.61.90.682.41.1
Inheritance Test4.13.62.41.43.32.5
Indexing Test6.15.64.12.45.14.0
Graph (Binary Tree) Test1.50.681.40.571.40.63
Multithreading Test8.77.23.32.76.04.9
All Tests4.73.72.71.53.72.6

The results above show that in general OpenJPA with Derby embedded is more efficient than OpenJPA with MySQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.68) to the normalized speed of OpenJPA with Derby embedded database (1.9) reveals that in that case, OpenJPA with Derby embedded is 2.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
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test14.83.222.622.718.712.9
Element Collection Test0.00310.00382.32.91.21.4
Inheritance Test0.0150.0177.06.93.53.4
Indexing Test11.72.426.523.419.112.9
Graph (Binary Tree) Test0.930.271.20.351.10.31
Multithreading Test25.20.1428.618.126.99.1
All Tests8.81.014.712.411.76.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test49.79.39.92.229.85.8
Element Collection Test2.74.89.61.16.12.9
Inheritance Test2.31.51.30.901.81.2
Indexing Test7.00.3117.12.112.11.2
Multithreading Test40.91.911.70.9926.31.4
All Tests20.53.69.91.515.22.5

The results above show that in general OpenJPA with Derby embedded is much 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 Derby embedded database (15.2) reveals that in these tests, OpenJPA with Derby embedded is 6.1 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 Derby embedded database (7.0) reveals that in that case, OpenJPA with Derby embedded is 22.6 times faster than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test5.60.745.21.65.41.2
Element Collection Test0.00900.0142.21.71.10.87
Inheritance Test0.0450.0484.62.02.31.0
Indexing Test6.10.748.73.07.41.9
Graph (Binary Tree) Test1.60.450.910.251.30.35
Multithreading Test18.30.554.52.911.41.7
All Tests5.30.424.41.94.81.2

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test4.20.984.51.74.31.4
Element Collection Test0.00710.00991.60.650.800.33
Inheritance Test0.0350.0333.01.51.50.75
Indexing Test5.30.643.62.04.41.3
Graph (Binary Tree) Test0.800.410.930.430.860.42
Multithreading Test5.70.276.22.96.01.6
All Tests2.70.393.31.53.00.96

The results above show that in general OpenJPA with Derby 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 Derby embedded database (3.0) reveals that in these tests, OpenJPA with Derby embedded is 3.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 Derby embedded database (5.7) reveals that in that case, OpenJPA with Derby embedded is 21.1 times faster than OpenJPA with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
Basic Person Test15.83.69.06.012.44.8
Element Collection Test1.11.33.51.42.31.3
Inheritance Test1.31.03.72.52.51.8
Indexing Test7.21.912.06.69.64.3
Graph (Binary Tree) Test1.20.451.10.401.20.43
Multithreading Test19.82.010.95.515.33.8
All Tests8.01.86.93.97.42.8

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (2.0) to the normalized speed of OpenJPA with Derby embedded database (19.8) reveals that in that case, OpenJPA with Derby embedded is 9.9 times faster than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons