Compare with

Comparison of OpenJPA with PostgreSQL server vs DataNucleus with H2 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
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Test5.23.44.82.25.02.8
Element Collection Test2.81.22.20.642.50.92
Inheritance Test4.63.03.21.93.92.4
Indexing Test7.45.36.93.57.14.4
Graph (Binary Tree) Test0.982.10.811.30.891.7
Multithreading Test23.410.09.14.316.27.2
All Tests7.44.24.52.35.93.2

The results above show that in general OpenJPA with PostgreSQL server is more efficient than DataNucleus with H2 server in persisting JPA entity objects to 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 H2 database server (0.64) to the normalized speed of OpenJPA with PostgreSQL database server (2.2) reveals that in that case, OpenJPA with PostgreSQL server is 3.4 times faster than DataNucleus with H2 server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Test5.82.516.15.210.93.9
Element Collection Test0.0130.568.71.14.40.82
Inheritance Test5.22.217.66.111.44.2
Indexing Test4.82.118.77.711.84.9
Graph (Binary Tree) Test0.275.70.358.90.317.3
Multithreading Test11.92.323.38.717.65.5
All Tests4.72.514.16.39.44.4

The results above show that in general OpenJPA with PostgreSQL server is more efficient than DataNucleus with H2 server in retrieving JPA entity objects from the database. Comparing the normalized speed of DataNucleus with H2 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 DataNucleus with H2 server.

A large performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (1.1) to the normalized speed of OpenJPA with PostgreSQL database server (8.7) reveals that in that case, OpenJPA with PostgreSQL server is 7.9 times faster than DataNucleus with H2 server.

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 H2 database server (0.56) reveals that in that case, OpenJPA with PostgreSQL server is 43.1 times slower than DataNucleus with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Testfailed4.1failed1.3failed2.7
Element Collection Testfailed4.0failed0.49failed2.3
Inheritance Testfailed2.9failed1.5failed2.2
Indexing Testfailed0.0036failed1.5failed0.75
Multithreading Testfailed1.3failedfailedfailed1.3
All Testsfailed2.5failed1.2failed1.9

OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions). DataNucleus with H2 server 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
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Test4.92.53.91.44.41.9
Element Collection Test0.0332.04.61.02.31.5
Inheritance Test4.82.44.92.34.92.3
Indexing Test5.12.76.03.05.62.9
Graph (Binary Tree) Test0.571.80.310.600.441.2
Multithreading Test22.2failed7.4failed14.8failed
All Tests6.32.34.51.75.42.0

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

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (1.0) to the normalized speed of OpenJPA with PostgreSQL database server (4.6) reveals that in that case, OpenJPA with PostgreSQL server is 4.6 times faster than DataNucleus with H2 server.

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 H2 database server (2.0) reveals that in that case, OpenJPA with PostgreSQL server is 60.6 times slower than DataNucleus with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Test4.63.45.31.35.02.3
Element Collection Test0.0321.52.80.681.41.1
Inheritance Test4.32.74.61.34.42.0
Indexing Test8.05.77.11.97.53.8
Graph (Binary Tree) Test0.531.50.551.20.541.3
Multithreading Test17.4failed9.15.113.35.1
All Tests5.83.04.91.95.42.4

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

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (0.68) to the normalized speed of OpenJPA with PostgreSQL database server (2.8) reveals that in that case, OpenJPA with PostgreSQL server is 4.1 times faster than DataNucleus with H2 server.

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 H2 database server (1.5) reveals that in that case, OpenJPA with PostgreSQL server is 46.9 times slower than DataNucleus with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
Basic Person Test5.13.27.52.36.32.7
Element Collection Test0.721.94.60.782.61.3
Inheritance Test4.72.67.62.66.22.6
Indexing Test6.33.29.73.58.03.3
Graph (Binary Tree) Test0.592.80.503.00.552.9
Multithreading Test18.74.512.26.015.55.3
All Tests6.02.97.02.86.52.9

The results above show that in general OpenJPA with PostgreSQL server is more efficient than DataNucleus with H2 server in performing JPA database operations. Comparing the normalized speed of DataNucleus with H2 database server (2.9) to the normalized speed of OpenJPA with PostgreSQL database server (6.5) reveals that in these tests, OpenJPA with PostgreSQL server is 2.2 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (0.78) to the normalized speed of OpenJPA with PostgreSQL database server (4.6) reveals that in that case, OpenJPA with PostgreSQL server is 5.9 times faster than DataNucleus with H2 server.

On the other hand, OpenJPA with PostgreSQL server is slower, for instance, when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.50) to the normalized speed of DataNucleus with H2 database server (3.0) reveals that in that case, OpenJPA with PostgreSQL server is 6.0 times slower than DataNucleus with H2 server.

Other Head to Head DBMS/JPA Comparisons