Compare with

Comparison of OpenJPA with MySQL 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
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Test0.154.62.15.31.15.0
Element Collection Testfailed3.81.33.81.33.8
Inheritance Test0.154.12.24.31.24.2
Indexing Test0.236.23.05.61.65.9
Graph (Binary Tree) Testfailed1.1failed1.3failed1.2
Multithreading Testfailedfailed5.3failed5.3failed
All Tests0.184.02.84.11.84.0

OpenJPA with MySQL server has failed in 4 tests (see exceptions). OpenJPA with Derby embedded has failed in 2 tests (see exceptions).

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. Comparing the normalized speed of OpenJPA with MySQL database server (1.8) to the normalized speed of OpenJPA with Derby embedded database (4.0) reveals that in these tests, OpenJPA with Derby embedded is 2.2 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of OpenJPA with Derby embedded database (4.6) reveals that in that case, OpenJPA with Derby embedded is 30.7 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
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Testfailed9.819.621.619.615.7
Element Collection Testfailed0.00401.22.31.21.2
Inheritance Testfailed0.01717.16.717.13.4
Indexing Testfailed9.519.221.319.215.4
Graph (Binary Tree) Testfailed0.57failed0.57failed0.57
Multithreading Testfailedfailed32.4failed32.4failed
All Testsfailed4.017.910.517.97.2

OpenJPA with MySQL server has failed in 7 tests (see exceptions). OpenJPA with Derby embedded has failed in 2 tests (see exceptions).

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Testfailed42.42.79.72.726.1
Element Collection Testfailed2.91.31.11.32.0
Inheritance Testfailed2.31.21.01.21.7
Indexing Testfailed5.25.614.05.69.6
Multithreading Testfailedfailedfailedfailedfailedfailed
All Testsfailed13.22.76.42.79.8

OpenJPA with MySQL server has failed in 6 tests (see exceptions). OpenJPA with Derby embedded has failed in 2 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Teststopped6.03.49.83.47.9
Element Collection Testfailed0.0161.63.91.62.0
Inheritance Testfailed0.0161.43.01.41.5
Indexing Testfailed7.13.810.83.89.0
Graph (Binary Tree) Testfailed0.88failed0.81failed0.84
Multithreading Testfailedfailed8.9failed8.9failed
All Tests0.00002.83.85.73.84.2

OpenJPA with MySQL server has failed in 6 tests (see exceptions). OpenJPA with Derby embedded has failed in 2 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Teststopped3.81.94.91.94.3
Element Collection Testfailed0.00880.611.80.610.90
Inheritance Testfailed0.0352.03.52.01.8
Indexing Testfailed4.32.64.02.64.1
Graph (Binary Tree) Testfailed0.67failed0.75failed0.71
Multithreading Testfailedfailed7.1failed7.1failed
All Tests0.00001.82.83.02.82.4

OpenJPA with MySQL server has failed in 6 tests (see exceptions). OpenJPA with Derby embedded has failed in 2 tests (see exceptions).

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
OpenJPA
MySQL server
OpenJPA
Derby embedded
Basic Person Test0.1513.36.010.25.011.8
Element Collection Testfailed1.31.22.61.22.0
Inheritance Test0.151.34.83.74.02.5
Indexing Test0.236.56.811.15.78.8
Graph (Binary Tree) Testfailed0.80failed0.86failed0.83
Multithreading Testfailedfailed13.4failed13.4failed
All Tests0.184.86.15.95.55.4

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

On the other hand, OpenJPA with MySQL server is slower, for instance, when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of OpenJPA with Derby embedded database (13.3) reveals that in that case, OpenJPA with MySQL server is 88.7 times slower than OpenJPA with Derby embedded.

Other Head to Head DBMS/JPA Comparisons