Compare with

Comparison of OpenJPA with PostgreSQL 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
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.214.24.84.85.09.5
Element Collection Test2.86.62.22.12.54.3
Inheritance Test4.613.63.24.63.99.1
Indexing Test7.424.66.911.17.117.8
Graph (Binary Tree) Test0.986.80.814.50.895.7
Multithreading Test23.438.59.18.516.223.5
All Tests7.417.44.55.95.911.7

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.98) to the normalized speed of DataNucleus with HSQLDB embedded database (6.8) reveals that in that case, DataNucleus with HSQLDB embedded is 6.9 times faster than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.86.616.110.210.98.4
Element Collection Test0.0133.68.78.14.45.8
Inheritance Test5.25.717.68.811.47.2
Indexing Test4.85.118.79.511.87.3
Graph (Binary Tree) Test0.277.20.359.30.318.3
Multithreading Test11.98.123.39.517.68.8
All Tests4.76.014.19.29.47.6

The results above show that in general OpenJPA with PostgreSQL server is slightly more efficient than DataNucleus with HSQLDB embedded in retrieving JPA entity objects from the database.

A large performance gap has been detected when using multithreading with large retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (9.5) to the normalized speed of OpenJPA with PostgreSQL database server (23.3) reveals that in that case, OpenJPA with PostgreSQL server is 2.5 times faster than DataNucleus with HSQLDB embedded.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Testfailed1.4failed0.48failed0.95
Element Collection Testfailed1.3failed0.67failed1.0
Inheritance Testfailed1.6failed0.61failed1.1
Indexing Testfailed0.0016failed0.63failed0.32
Multithreading Testfailed0.40failedfailedfailed0.40
All Testsfailed0.96failed0.60failed0.80

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test4.911.53.92.74.47.1
Element Collection Test0.0336.94.62.72.34.8
Inheritance Test4.810.34.93.64.96.9
Indexing Test5.111.46.04.45.67.9
Graph (Binary Tree) Test0.573.50.311.50.442.5
Multithreading Test22.2failed7.4failed14.8failed
All Tests6.38.74.53.05.45.8

DataNucleus with HSQLDB embedded has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with HSQLDB embedded is slightly more efficient than OpenJPA with PostgreSQL server in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.033) to the normalized speed of DataNucleus with HSQLDB embedded database (6.9) reveals that in that case, DataNucleus with HSQLDB embedded is 209 times faster than OpenJPA with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test4.64.25.31.35.02.8
Element Collection Test0.0324.92.81.61.43.2
Inheritance Test4.34.04.61.34.42.7
Indexing Test8.07.57.11.97.54.7
Graph (Binary Tree) Test0.532.90.552.00.542.5
Multithreading Test17.440.19.113.713.326.9
All Tests5.810.64.93.75.47.1

The results above show that in general DataNucleus with HSQLDB embedded is more efficient than OpenJPA with PostgreSQL server in deleting JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.032) to the normalized speed of DataNucleus with HSQLDB embedded database (4.9) reveals that in that case, DataNucleus with HSQLDB embedded is 153 times faster than OpenJPA with PostgreSQL server.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of OpenJPA with PostgreSQL database server (5.3) reveals that in that case, DataNucleus with HSQLDB embedded is 4.1 times slower than OpenJPA with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
OpenJPA
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.17.67.53.96.35.7
Element Collection Test0.724.74.63.02.63.8
Inheritance Test4.77.17.63.86.25.4
Indexing Test6.39.79.75.58.07.6
Graph (Binary Tree) Test0.595.10.504.30.554.7
Multithreading Test18.721.812.210.615.517.0
All Tests6.09.07.04.86.57.0

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

A large performance gap has been detected when using graphs of objects with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.59) to the normalized speed of DataNucleus with HSQLDB embedded database (5.1) reveals that in that case, DataNucleus with HSQLDB embedded is 8.6 times faster than OpenJPA with PostgreSQL server.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (3.8) to the normalized speed of OpenJPA with PostgreSQL database server (7.6) reveals that in that case, DataNucleus with HSQLDB embedded is 2.0 times slower than OpenJPA with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons