Compare with

Comparison of OpenJPA with Derby embedded 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
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test4.84.12.92.63.93.3
Element Collection Test2.80.911.90.382.40.64
Inheritance Test4.13.82.42.43.33.1
Indexing Test6.16.04.16.45.16.2
Graph (Binary Tree) Test1.50.911.40.771.40.84
Multithreading Test8.718.03.38.36.013.1
All Tests4.75.62.73.53.74.5

The results above show that in general DataNucleus with PostgreSQL server is slightly more efficient than OpenJPA 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 OpenJPA with Derby embedded database (3.3) to the normalized speed of DataNucleus with PostgreSQL database server (8.3) reveals that in that case, DataNucleus with PostgreSQL server is 2.5 times faster than OpenJPA with Derby embedded.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.38) to the normalized speed of OpenJPA with Derby embedded database (1.9) reveals that in that case, DataNucleus with PostgreSQL server is 5.0 times slower than OpenJPA with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test14.81.722.67.618.74.6
Element Collection Test0.00310.732.30.631.20.68
Inheritance Test0.0151.57.09.33.55.4
Indexing Test11.71.526.59.219.15.3
Graph (Binary Tree) Test0.932.61.212.31.17.4
Multithreading Test25.23.428.610.826.97.1
All Tests8.81.914.78.311.75.1

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

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test49.749.19.94.729.826.9
Element Collection Test2.739.19.60.486.119.8
Inheritance Test2.355.91.36.61.831.2
Indexing Test7.00.04817.16.412.13.2
Multithreading Test40.9failed11.7failed26.3failed
All Tests20.536.09.94.515.220.3

DataNucleus with PostgreSQL server has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with PostgreSQL server is more efficient than OpenJPA with Derby embedded in executing the tested JPA queries.

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (2.3) to the normalized speed of DataNucleus with PostgreSQL database server (55.9) reveals that in that case, DataNucleus with PostgreSQL server is 24.3 times faster than OpenJPA with Derby embedded.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.048) to the normalized speed of OpenJPA with Derby embedded database (7.0) reveals that in that case, DataNucleus with PostgreSQL server is 146 times slower than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test5.62.15.20.845.41.5
Element Collection Test0.00901.42.20.641.11.0
Inheritance Test0.0452.14.61.22.31.7
Indexing Test6.12.28.71.57.41.8
Graph (Binary Tree) Test1.60.650.910.201.30.42
Multithreading Test18.30.464.5failed11.40.46
All Tests5.31.54.40.874.81.2

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

The results above show that in general OpenJPA with Derby embedded is much more efficient than DataNucleus with PostgreSQL server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.2) to the normalized speed of OpenJPA with Derby embedded database (4.8) reveals that in these tests, OpenJPA with Derby embedded is 4.0 times faster than DataNucleus with PostgreSQL server.

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

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0090) to the normalized speed of DataNucleus with PostgreSQL database server (1.4) reveals that in that case, OpenJPA with Derby embedded is 156 times slower than DataNucleus with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test4.23.04.51.34.32.2
Element Collection Test0.00711.01.60.390.800.69
Inheritance Test0.0352.83.01.31.52.1
Indexing Test5.35.43.61.94.43.7
Graph (Binary Tree) Test0.800.380.930.370.860.37
Multithreading Test5.713.86.2failed6.013.8
All Tests2.74.43.31.13.02.9

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

The results above show that in general OpenJPA with Derby embedded is slightly more efficient than DataNucleus with PostgreSQL server in deleting JPA entity objects from 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.39) to the normalized speed of OpenJPA with Derby embedded database (1.6) reveals that in that case, OpenJPA with Derby embedded is 4.1 times faster than DataNucleus with PostgreSQL server.

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0071) to the normalized speed of DataNucleus with PostgreSQL database server (1.0) reveals that in that case, OpenJPA with Derby embedded is 141 times slower than DataNucleus with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
OpenJPA
Derby embedded
DataNucleus
PostgreSQL server
Basic Person Test15.812.09.03.412.47.7
Element Collection Test1.18.63.50.502.34.6
Inheritance Test1.313.23.74.22.58.7
Indexing Test7.23.012.05.19.64.0
Graph (Binary Tree) Test1.21.11.13.41.22.3
Multithreading Test19.88.910.99.515.39.1
All Tests8.08.06.93.87.46.0

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

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

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

Other Head to Head DBMS/JPA Comparisons