Compare with

Comparison of OpenJPA with PostgreSQL server vs OpenJPA with Derby 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
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Test5.23.14.82.75.02.9
Element Collection Test2.82.02.21.72.51.8
Inheritance Test4.63.03.22.33.92.6
Indexing Test7.44.76.94.17.14.4
Graph (Binary Tree) Test0.980.710.810.640.890.67
Multithreading Test23.46.09.13.816.24.9
All Tests7.43.34.52.55.92.9

The results above show that in general OpenJPA with PostgreSQL server is more efficient than OpenJPA with Derby server in persisting JPA entity objects to the database. Comparing the normalized speed of OpenJPA with Derby database server (2.9) to the normalized speed of OpenJPA with PostgreSQL database server (5.9) reveals that in these tests, OpenJPA with PostgreSQL server is 2.0 times faster than OpenJPA with Derby server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Test5.80.7816.111.610.96.2
Element Collection Test0.0130.00248.71.14.40.54
Inheritance Test5.20.01417.65.011.42.5
Indexing Test4.80.6218.713.011.86.8
Graph (Binary Tree) Test0.270.0650.350.390.310.23
Multithreading Test11.91.623.319.017.610.3
All Tests4.70.5114.18.49.44.4

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

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 database server (0.014) to the normalized speed of OpenJPA with PostgreSQL database server (5.2) reveals that in that case, OpenJPA with PostgreSQL server is 371 times faster than OpenJPA with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Testfailed29.2failed5.5failed17.3
Element Collection Testfailed2.2failed1.4failed1.8
Inheritance Testfailed2.2failed1.0failed1.6
Indexing Testfailed2.2failed11.7failed7.0
Multithreading Testfailed35.5failed8.3failed21.9
All Testsfailed14.3failed5.6failed9.9

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
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Test4.91.53.94.04.42.8
Element Collection Test0.0330.00814.61.92.30.94
Inheritance Test4.80.0434.93.84.91.9
Indexing Test5.11.86.06.85.64.3
Graph (Binary Tree) Test0.570.160.310.270.440.22
Multithreading Test22.26.97.45.014.85.9
All Tests6.31.74.53.65.42.7

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

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 database server (0.043) to the normalized speed of OpenJPA with PostgreSQL database server (4.8) reveals that in that case, OpenJPA with PostgreSQL server is 112 times faster than OpenJPA with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Test4.61.45.33.75.02.5
Element Collection Test0.0320.00822.81.41.40.71
Inheritance Test4.30.0354.62.54.41.3
Indexing Test8.02.37.13.57.52.9
Graph (Binary Tree) Test0.530.130.550.350.540.24
Multithreading Test17.43.69.14.013.33.8
All Tests5.81.34.92.65.41.9

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

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 database server (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 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
OpenJPA
PostgreSQL server
OpenJPA
Derby server
Basic Person Test5.17.27.55.56.36.4
Element Collection Test0.720.844.61.52.61.2
Inheritance Test4.71.17.62.96.22.0
Indexing Test6.32.39.77.88.05.1
Graph (Binary Tree) Test0.590.270.500.410.550.34
Multithreading Test18.710.712.28.015.59.4
All Tests6.03.97.04.56.54.2

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

A large 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 Derby database server (1.1) to the normalized speed of OpenJPA with PostgreSQL database server (4.7) reveals that in that case, OpenJPA with PostgreSQL server is 4.3 times faster than OpenJPA with Derby server.

Other Head to Head DBMS/JPA Comparisons