Compare with

Comparison of OpenJPA with H2 server vs DataNucleus 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
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.74.12.22.62.93.3
Element Collection Test2.60.911.50.382.10.64
Inheritance Test4.53.82.02.43.23.1
Indexing Test7.36.03.66.45.46.2
Graph (Binary Tree) Test1.10.910.840.770.970.84
Multithreading Test7.718.04.28.35.913.1
All Tests4.55.62.43.53.44.5

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

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

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.38) to the normalized speed of OpenJPA with H2 database server (1.5) reveals that in that case, DataNucleus with PostgreSQL server is 3.9 times slower than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test2.91.77.67.65.24.6
Element Collection Test0.00220.731.90.630.930.68
Inheritance Test0.0131.54.09.32.05.4
Indexing Test4.11.58.89.26.55.3
Graph (Binary Tree) Test0.382.60.4912.30.447.4
Multithreading Test5.93.414.010.810.07.1
All Tests2.21.96.18.34.25.1

The results above show that in general DataNucleus with PostgreSQL server is slightly more efficient than OpenJPA with H2 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 H2 database server (0.0022) to the normalized speed of DataNucleus with PostgreSQL database server (0.73) reveals that in that case, DataNucleus with PostgreSQL server is 332 times faster than OpenJPA with H2 server.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.63) to the normalized speed of OpenJPA with H2 database server (1.9) reveals that in that case, DataNucleus with PostgreSQL server is 3.0 times slower than OpenJPA with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.749.11.04.72.426.9
Element Collection Test2.039.11.20.481.619.8
Inheritance Test2.855.91.16.62.031.2
Indexing Test3.80.0487.56.45.73.2
Multithreading Test0.98failed1.0failed1.0failed
All Tests2.736.02.44.52.520.3

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

The results above show that in general DataNucleus with PostgreSQL server is much more efficient than OpenJPA with H2 server in executing the tested JPA queries. Comparing the normalized speed of OpenJPA with H2 database server (2.5) to the normalized speed of DataNucleus with PostgreSQL database server (20.3) reveals that in these tests, DataNucleus with PostgreSQL server is 8.1 times faster than OpenJPA with H2 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 H2 database server (2.8) to the normalized speed of DataNucleus with PostgreSQL database server (55.9) reveals that in that case, DataNucleus with PostgreSQL server is 20.0 times faster than OpenJPA with H2 server.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.048) to the normalized speed of OpenJPA with H2 database server (3.8) reveals that in that case, DataNucleus with PostgreSQL server is 79.2 times slower than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.02.12.00.842.51.5
Element Collection Test0.00781.41.90.640.941.0
Inheritance Test0.0342.12.81.21.41.7
Indexing Test2.82.23.21.53.01.8
Graph (Binary Tree) Test0.790.650.430.200.610.42
Multithreading Test7.00.462.5failed4.80.46
All Tests2.31.52.10.872.21.2

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

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.46) to the normalized speed of OpenJPA with H2 database server (7.0) reveals that in that case, OpenJPA with H2 server is 15.2 times faster than DataNucleus with PostgreSQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0078) to the normalized speed of DataNucleus with PostgreSQL database server (1.4) reveals that in that case, OpenJPA with H2 server is 179 times slower than DataNucleus with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.23.02.21.32.72.2
Element Collection Test0.00601.00.880.390.440.69
Inheritance Test0.0302.83.11.31.62.1
Indexing Test6.55.43.61.95.13.7
Graph (Binary Tree) Test0.730.380.750.370.740.37
Multithreading Test7.613.85.2failed6.413.8
All Tests3.04.42.61.12.82.9

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

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

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.3) to the normalized speed of OpenJPA with H2 database server (3.1) reveals that in that case, DataNucleus with PostgreSQL server is 2.4 times slower than OpenJPA with H2 server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
OpenJPA
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.312.03.03.43.17.7
Element Collection Test0.938.61.50.501.24.6
Inheritance Test1.513.22.64.22.08.7
Indexing Test4.93.05.45.15.14.0
Graph (Binary Tree) Test0.751.10.633.40.692.3
Multithreading Test5.98.95.49.55.69.1
All Tests2.98.03.23.83.06.0

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

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

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

Other Head to Head DBMS/JPA Comparisons