Compare with

Comparison of DataNucleus with H2 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
 DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test19.25.28.04.813.65.0
Element Collection Test6.62.82.82.24.72.5
Inheritance Test15.64.64.43.210.03.9
Indexing Test24.47.411.86.918.17.1
Graph (Binary Tree) Test9.20.986.20.817.70.89
Multithreading Test34.923.47.19.121.016.2
All Tests18.37.46.74.512.55.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test13.25.813.516.113.310.9
Element Collection Test6.40.0138.98.77.74.4
Inheritance Test12.25.212.717.612.411.4
Indexing Test8.14.816.518.712.311.8
Graph (Binary Tree) Test10.60.2720.90.3515.80.31
Multithreading Test13.311.99.923.311.617.6
All Tests10.64.713.714.112.29.4

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

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

On the other hand, DataNucleus with H2 embedded is slower, for instance, when using multithreading with large retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (9.9) to the normalized speed of OpenJPA with PostgreSQL database server (23.3) reveals that in that case, DataNucleus with H2 embedded is 2.4 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
 DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test4.7failed1.4failed3.1failed
Element Collection Test5.0failed2.4failed3.7failed
Inheritance Test3.8failed1.6failed2.7failed
Indexing Test0.0041failed1.8failed0.91failed
Multithreading Test1.2failed0.79failed1.0failed
All Tests3.0failed1.6failed2.3failed

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 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test10.04.93.93.96.94.4
Element Collection Test7.60.0333.94.65.82.3
Inheritance Test9.44.84.44.96.94.9
Indexing Test10.65.15.96.08.25.6
Graph (Binary Tree) Test5.90.573.70.314.80.44
Multithreading Testfailed22.2failed7.4failed14.8
All Tests8.76.34.44.56.55.4

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test4.24.61.35.32.85.0
Element Collection Test4.90.0321.62.83.21.4
Inheritance Test4.04.31.34.62.74.4
Indexing Test7.58.01.97.14.77.5
Graph (Binary Tree) Test5.60.534.10.554.80.54
Multithreading Testfailed17.4failed9.1failed13.3
All Tests5.25.82.04.93.65.4

DataNucleus with H2 embedded 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 embedded in deleting JPA entity objects from the database.

A large performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with H2 embedded database (1.3) to the normalized speed of OpenJPA with PostgreSQL database server (5.3) reveals that in that case, OpenJPA with PostgreSQL server is 4.1 times faster than DataNucleus with H2 embedded.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
DataNucleus
H2 embedded
OpenJPA
PostgreSQL server
Basic Person Test10.35.15.67.57.96.3
Element Collection Test6.10.723.94.65.02.6
Inheritance Test9.04.74.97.66.96.2
Indexing Test10.16.37.69.78.98.0
Graph (Binary Tree) Test7.80.598.70.508.30.55
Multithreading Test16.518.75.912.211.215.5
All Tests9.66.06.07.07.86.5

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

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

On the other hand, DataNucleus with H2 embedded is slower, for instance, when using multithreading with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (5.9) to the normalized speed of OpenJPA with PostgreSQL database server (12.2) reveals that in that case, DataNucleus with H2 embedded is 2.1 times slower than OpenJPA with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons