Compare with

Comparison of OpenJPA with Derby embedded vs OpenJPA 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
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test4.85.22.94.83.95.0
Element Collection Test2.82.81.92.22.42.5
Inheritance Test4.14.62.43.23.33.9
Indexing Test6.17.44.16.95.17.1
Graph (Binary Tree) Test1.50.981.40.811.40.89
Multithreading Test8.723.43.39.16.016.2
All Tests4.77.42.74.53.75.9

The results above show that in general OpenJPA with PostgreSQL server is 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 OpenJPA with PostgreSQL database server (9.1) reveals that in that case, OpenJPA with PostgreSQL server is 2.8 times faster 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
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test14.85.822.616.118.710.9
Element Collection Test0.00310.0132.38.71.24.4
Inheritance Test0.0155.27.017.63.511.4
Indexing Test11.74.826.518.719.111.8
Graph (Binary Tree) Test0.930.271.20.351.10.31
Multithreading Test25.211.928.623.326.917.6
All Tests8.84.714.714.111.79.4

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

A large performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.27) to the normalized speed of OpenJPA with Derby embedded database (0.93) reveals that in that case, OpenJPA with Derby embedded is 3.4 times faster than OpenJPA 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 retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.015) to the normalized speed of OpenJPA with PostgreSQL database server (5.2) reveals that in that case, OpenJPA with Derby embedded is 347 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
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test49.7failed9.9failed29.8failed
Element Collection Test2.7failed9.6failed6.1failed
Inheritance Test2.3failed1.3failed1.8failed
Indexing Test7.0failed17.1failed12.1failed
Multithreading Test40.9failed11.7failed26.3failed
All Tests20.5failed9.9failed15.2failed

OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test5.64.95.23.95.44.4
Element Collection Test0.00900.0332.24.61.12.3
Inheritance Test0.0454.84.64.92.34.9
Indexing Test6.15.18.76.07.45.6
Graph (Binary Tree) Test1.60.570.910.311.30.44
Multithreading Test18.322.24.57.411.414.8
All Tests5.36.34.44.54.85.4

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

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

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.31) to the normalized speed of OpenJPA with Derby embedded database (0.91) reveals that in that case, OpenJPA with PostgreSQL server is 2.9 times slower than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test4.24.64.55.34.35.0
Element Collection Test0.00710.0321.62.80.801.4
Inheritance Test0.0354.33.04.61.54.4
Indexing Test5.38.03.67.14.47.5
Graph (Binary Tree) Test0.800.530.930.550.860.54
Multithreading Test5.717.46.29.16.013.3
All Tests2.75.83.34.93.05.4

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
OpenJPA
Derby embedded
OpenJPA
PostgreSQL server
Basic Person Test15.85.19.07.512.46.3
Element Collection Test1.10.723.54.62.32.6
Inheritance Test1.34.73.77.62.56.2
Indexing Test7.26.312.09.79.68.0
Graph (Binary Tree) Test1.20.591.10.501.20.55
Multithreading Test19.818.710.912.215.315.5
All Tests8.06.06.97.07.46.5

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

A large performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (5.1) to the normalized speed of OpenJPA with Derby embedded database (15.8) reveals that in that case, OpenJPA with Derby embedded is 3.1 times faster than OpenJPA 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 OpenJPA with PostgreSQL database server (4.7) reveals that in that case, OpenJPA with Derby embedded is 3.6 times slower than OpenJPA with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons