Compare with

Comparison of DataNucleus with H2 server 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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test3.45.22.24.82.85.0
Element Collection Test1.22.80.642.20.922.5
Inheritance Test3.04.61.93.22.43.9
Indexing Test5.37.43.56.94.47.1
Graph (Binary Tree) Test2.10.981.30.811.70.89
Multithreading Test10.023.44.39.17.216.2
All Tests4.27.42.34.53.25.9

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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test2.55.85.216.13.910.9
Element Collection Test0.560.0131.18.70.824.4
Inheritance Test2.25.26.117.64.211.4
Indexing Test2.14.87.718.74.911.8
Graph (Binary Tree) Test5.70.278.90.357.30.31
Multithreading Test2.311.98.723.35.517.6
All Tests2.54.76.314.14.49.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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test4.1failed1.3failed2.7failed
Element Collection Test4.0failed0.49failed2.3failed
Inheritance Test2.9failed1.5failed2.2failed
Indexing Test0.0036failed1.5failed0.75failed
Multithreading Test1.3failedfailedfailed1.3failed
All Tests2.5failed1.2failed1.9failed

DataNucleus with H2 server has failed in 1 tests (see exceptions). 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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test2.54.91.43.91.94.4
Element Collection Test2.00.0331.04.61.52.3
Inheritance Test2.44.82.34.92.34.9
Indexing Test2.75.13.06.02.95.6
Graph (Binary Tree) Test1.80.570.600.311.20.44
Multithreading Testfailed22.2failed7.4failed14.8
All Tests2.36.31.74.52.05.4

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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test3.44.61.35.32.35.0
Element Collection Test1.50.0320.682.81.11.4
Inheritance Test2.74.31.34.62.04.4
Indexing Test5.78.01.97.13.87.5
Graph (Binary Tree) Test1.50.531.20.551.30.54
Multithreading Testfailed17.45.19.15.113.3
All Tests3.05.81.94.92.45.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
 DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
DataNucleus
H2 server
OpenJPA
PostgreSQL server
Basic Person Test3.25.12.37.52.76.3
Element Collection Test1.90.720.784.61.32.6
Inheritance Test2.64.72.67.62.66.2
Indexing Test3.26.33.59.73.38.0
Graph (Binary Tree) Test2.80.593.00.502.90.55
Multithreading Test4.518.76.012.25.315.5
All Tests2.96.02.87.02.96.5

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