Compare with

Comparison of OpenJPA with MySQL server vs DataNucleus with HSQLDB 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
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test0.156.22.13.71.15.0
Element Collection Testfailed3.51.32.21.32.8
Inheritance Test0.156.22.23.71.25.0
Indexing Test0.2310.43.05.31.67.9
Graph (Binary Tree) Testfailed0.11failed0.10failed0.10
Multithreading Testfailed11.35.35.65.38.4
All Tests0.186.32.83.41.84.9

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

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

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.23) to the normalized speed of DataNucleus with HSQLDB embedded database (10.4) reveals that in that case, DataNucleus with HSQLDB embedded is 45.2 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
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Testfailed5.319.610.419.67.8
Element Collection Testfailed3.11.24.11.23.6
Inheritance Testfailed5.617.110.317.18.0
Indexing Testfailed5.319.210.419.27.8
Graph (Binary Tree) Testfailedstoppedfailedstoppedfailedstopped
Multithreading Testfailed8.432.411.932.410.2
All Testsfailed5.617.99.417.97.5

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Testfailed1.72.70.632.71.2
Element Collection Testfailed2.01.30.601.31.3
Inheritance Testfailed1.71.20.701.21.2
Indexing Testfailed0.00225.60.605.60.30
Multithreading Testfailed1.9failed1.4failed1.6
All Testsfailed1.52.70.782.71.1

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Teststopped5.93.43.23.44.6
Element Collection Testfailed3.51.62.01.62.7
Inheritance Testfailed1.91.41.31.41.6
Indexing Testfailed6.53.83.63.85.1
Graph (Binary Tree) Testfailedstoppedfailedstoppedfailedstopped
Multithreading Testfailedfailed8.9failed8.9failed
All Tests0.00004.43.82.53.83.5

OpenJPA with MySQL server has failed in 6 tests (see exceptions). DataNucleus with HSQLDB 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
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Teststopped3.81.91.41.92.6
Element Collection Testfailed3.90.611.50.612.7
Inheritance Testfailed4.12.01.62.02.9
Indexing Testfailed5.62.62.12.63.8
Graph (Binary Tree) Testfailedstoppedfailedstoppedfailedstopped
Multithreading Testfailedfailed7.119.27.119.2
All Tests0.00004.42.85.22.84.8

OpenJPA with MySQL server has failed in 6 tests (see exceptions). DataNucleus with HSQLDB embedded has failed in 1 tests (see exceptions).

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
OpenJPA
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test0.154.66.03.95.04.2
Element Collection Testfailed3.21.22.11.22.6
Inheritance Test0.153.94.83.54.03.7
Indexing Test0.235.66.84.45.75.0
Graph (Binary Tree) Testfailed0.11failed0.10failed0.10
Multithreading Testfailed7.213.49.513.48.5
All Tests0.184.56.14.35.54.4

The results above show that in general OpenJPA with MySQL server is slightly more efficient than DataNucleus with HSQLDB 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 DataNucleus with HSQLDB embedded database (4.6) reveals that in that case, OpenJPA with MySQL server is 30.7 times slower than DataNucleus with HSQLDB embedded.

Other Head to Head DBMS/JPA Comparisons