Compare with

Comparison of OpenJPA with PostgreSQL server vs DataNucleus 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
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.24.64.82.85.03.7
Element Collection Test2.82.42.21.62.52.0
Inheritance Test4.64.63.22.73.93.7
Indexing Test7.47.66.94.87.16.2
Graph (Binary Tree) Test0.981.60.811.40.891.5
Multithreading Test23.48.69.13.316.25.9
All Tests7.44.94.52.85.93.8

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

A large performance gap has been detected when using multithreading with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (3.3) to the normalized speed of OpenJPA with PostgreSQL database server (9.1) reveals that in that case, OpenJPA with PostgreSQL server is 2.8 times faster than DataNucleus with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.86.816.114.910.910.9
Element Collection Test0.0135.48.77.64.46.5
Inheritance Test5.28.817.614.811.411.8
Indexing Test4.89.218.714.111.811.6
Graph (Binary Tree) Test0.279.90.3515.80.3112.9
Multithreading Test11.911.923.311.517.611.7
All Tests4.78.714.113.19.410.9

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

A huge performance gap has been detected 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 Derby embedded database (5.4) reveals that in that case, DataNucleus with Derby embedded is 415 times faster than OpenJPA with PostgreSQL server.

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using multithreading with large retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (11.5) to the normalized speed of OpenJPA with PostgreSQL database server (23.3) reveals that in that case, DataNucleus with Derby embedded is 2.0 times slower than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Testfailed39.1failed7.5failed23.3
Element Collection Testfailed46.0failed6.7failed26.3
Inheritance Testfailed7.7failed3.8failed5.7
Indexing Testfailed0.053failed8.0failed4.0
Multithreading Testfailedfailedfailedfailedfailedfailed
All Testsfailed23.2failed6.5failed14.8

OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions). DataNucleus 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
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test4.94.03.93.84.43.9
Element Collection Test0.0333.74.64.52.34.1
Inheritance Test4.84.44.94.84.94.6
Indexing Test5.15.26.04.25.64.7
Graph (Binary Tree) Test0.572.70.311.50.442.1
Multithreading Test22.2failed7.4failed14.8failed
All Tests6.34.04.53.75.43.9

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

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

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, 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 Derby embedded database (3.7) reveals that in that case, OpenJPA with PostgreSQL server is 112 times slower than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test4.63.55.31.35.02.4
Element Collection Test0.0321.92.81.61.41.7
Inheritance Test4.32.44.61.34.41.9
Indexing Test8.06.67.11.97.54.3
Graph (Binary Tree) Test0.530.810.550.930.540.87
Multithreading Test17.4failed9.1failed13.3failed
All Tests5.83.04.91.45.42.2

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

The results above show that in general OpenJPA with PostgreSQL server is more efficient than DataNucleus with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby embedded database (2.2) to the normalized speed of OpenJPA with PostgreSQL database server (5.4) reveals that in these tests, OpenJPA with PostgreSQL server is 2.5 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.3) to the normalized speed of OpenJPA with PostgreSQL database server (5.3) reveals that in that case, OpenJPA with PostgreSQL server is 4.1 times faster than DataNucleus with Derby embedded.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, 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 Derby embedded database (1.9) reveals that in that case, OpenJPA with PostgreSQL server is 59.4 times slower than DataNucleus with Derby embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
OpenJPA
PostgreSQL server
DataNucleus
Derby embedded
Basic Person Test5.111.67.56.16.38.8
Element Collection Test0.7211.94.64.42.68.1
Inheritance Test4.75.67.65.56.25.5
Indexing Test6.35.79.76.68.06.2
Graph (Binary Tree) Test0.593.70.504.90.554.3
Multithreading Test18.710.312.27.415.58.8
All Tests6.08.07.05.76.56.9

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

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

Other Head to Head DBMS/JPA Comparisons