Compare with

Comparison of OpenJPA with MySQL server vs DataNucleus with PostgreSQL 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
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test0.151.12.10.711.10.91
Element Collection Testfailed0.561.30.361.30.46
Inheritance Test0.151.22.20.691.20.92
Indexing Test0.231.83.01.01.61.4
Graph (Binary Tree) Testfailed0.34failed0.37failed0.36
Multithreading Testfailed2.95.31.85.32.4
All Tests0.181.32.80.821.81.1

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

The results above show that in general OpenJPA with MySQL server is more efficient than DataNucleus with PostgreSQL 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 DataNucleus with PostgreSQL database server (0.36) to the normalized speed of OpenJPA with MySQL database server (1.3) reveals that in that case, OpenJPA with MySQL server is 3.6 times faster than DataNucleus with PostgreSQL server.

On the other hand, OpenJPA with MySQL server is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of DataNucleus with PostgreSQL database server (1.2) reveals that in that case, OpenJPA with MySQL server is 8.0 times slower than DataNucleus with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Testfailed2.219.610.819.66.5
Element Collection Testfailed0.801.20.701.20.75
Inheritance Testfailed2.217.110.917.16.6
Indexing Testfailed2.019.210.419.26.2
Graph (Binary Tree) Testfailed3.5failed7.4failed5.5
Multithreading Testfailed4.532.412.832.48.6
All Testsfailed2.517.98.817.95.7

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
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Testfailed50.52.76.22.728.4
Element Collection Testfailed47.91.30.511.324.2
Inheritance Testfailed66.31.27.31.236.8
Indexing Testfailed0.0645.66.15.63.1
Multithreading Testfailedfailedfailedfailedfailedfailed
All Testsfailed41.22.75.02.723.1

OpenJPA with MySQL server has failed in 6 tests (see exceptions). DataNucleus with PostgreSQL server 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
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Teststopped1.23.40.683.40.94
Element Collection Testfailed0.851.60.481.60.66
Inheritance Testfailed0.411.40.291.40.35
Indexing Testfailed1.43.80.753.81.1
Graph (Binary Tree) Testfailed0.28failed0.23failed0.26
Multithreading Testfailedfailed8.9failed8.9failed
All Tests0.00000.823.80.493.80.66

OpenJPA with MySQL server has failed in 6 tests (see exceptions). DataNucleus with PostgreSQL server 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
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Teststopped3.01.93.41.93.2
Element Collection Testfailed0.960.610.460.610.71
Inheritance Testfailed3.12.03.72.03.4
Indexing Testfailed4.42.64.92.64.7
Graph (Binary Tree) Testfailed0.58failed0.70failed0.64
Multithreading Testfailedfailed7.1failed7.1failed
All Tests0.00002.42.82.62.82.5

OpenJPA with MySQL server has failed in 6 tests (see exceptions). DataNucleus with PostgreSQL server 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
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
OpenJPA
MySQL server
DataNucleus
PostgreSQL server
Basic Person Test0.1511.66.04.45.08.0
Element Collection Testfailed10.21.20.501.25.4
Inheritance Test0.1514.64.84.64.09.6
Indexing Test0.231.96.84.65.73.3
Graph (Binary Tree) Testfailed1.2failed2.2failed1.7
Multithreading Testfailed3.713.47.313.45.5
All Tests0.187.86.13.65.55.7

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.15) to the normalized speed of DataNucleus with PostgreSQL database server (14.6) reveals that in that case, DataNucleus with PostgreSQL server is 97.3 times faster than OpenJPA with MySQL server.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.50) to the normalized speed of OpenJPA with MySQL database server (1.2) reveals that in that case, DataNucleus with PostgreSQL server is 2.4 times slower than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons