Compare with

Comparison of DataNucleus 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
 DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.44.12.22.62.83.3
Element Collection Test1.20.910.640.380.920.64
Inheritance Test3.03.81.92.42.43.1
Indexing Test5.36.03.56.44.46.2
Graph (Binary Tree) Test2.10.911.30.771.70.84
Multithreading Test10.018.04.38.37.213.1
All Tests4.25.62.33.53.24.5

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

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.91) to the normalized speed of DataNucleus with H2 database server (2.1) reveals that in that case, DataNucleus with PostgreSQL server is 2.3 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
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test2.51.75.27.63.94.6
Element Collection Test0.560.731.10.630.820.68
Inheritance Test2.21.56.19.34.25.4
Indexing Test2.11.57.79.24.95.3
Graph (Binary Tree) Test5.72.68.912.37.37.4
Multithreading Test2.33.48.710.85.57.1
All Tests2.51.96.38.34.45.1

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

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using graphs of objects with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (2.6) to the normalized speed of DataNucleus with H2 database server (5.7) reveals that in that case, DataNucleus with PostgreSQL server is 2.2 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
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test4.149.11.34.72.726.9
Element Collection Test4.039.10.490.482.319.8
Inheritance Test2.955.91.56.62.231.2
Indexing Test0.00360.0481.56.40.753.2
Multithreading Test1.3failedfailedfailed1.3failed
All Tests2.536.01.24.51.920.3

DataNucleus with H2 server has failed in 1 tests (see exceptions). 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 DataNucleus with H2 server in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 database server (1.9) to the normalized speed of DataNucleus with PostgreSQL database server (20.3) reveals that in these tests, DataNucleus with PostgreSQL server is 10.7 times faster than DataNucleus 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 DataNucleus with H2 database server (2.9) to the normalized speed of DataNucleus with PostgreSQL database server (55.9) reveals that in that case, DataNucleus with PostgreSQL server is 19.3 times faster than DataNucleus with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test2.52.11.40.841.91.5
Element Collection Test2.01.41.00.641.51.0
Inheritance Test2.42.12.31.22.31.7
Indexing Test2.72.23.01.52.91.8
Graph (Binary Tree) Test1.80.650.600.201.20.42
Multithreading Testfailed0.46failedfailedfailed0.46
All Tests2.31.51.70.872.01.2

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

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

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.20) to the normalized speed of DataNucleus with H2 database server (0.60) reveals that in that case, DataNucleus with H2 server is 3.0 times faster than DataNucleus with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.43.01.31.32.32.2
Element Collection Test1.51.00.680.391.10.69
Inheritance Test2.72.81.31.32.02.1
Indexing Test5.75.41.91.93.83.7
Graph (Binary Tree) Test1.50.381.20.371.30.37
Multithreading Testfailed13.85.1failed5.113.8
All Tests3.04.41.91.12.42.9

DataNucleus with H2 server has failed in 1 tests (see exceptions). 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 DataNucleus with H2 server in deleting JPA entity objects from the database.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using graphs of objects with small transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.38) to the normalized speed of DataNucleus with H2 database server (1.5) reveals that in that case, DataNucleus with PostgreSQL server is 3.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
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
DataNucleus
H2 server
DataNucleus
PostgreSQL server
Basic Person Test3.212.02.33.42.77.7
Element Collection Test1.98.60.780.501.34.6
Inheritance Test2.613.22.64.22.68.7
Indexing Test3.23.03.55.13.34.0
Graph (Binary Tree) Test2.81.13.03.42.92.3
Multithreading Test4.58.96.09.55.39.1
All Tests2.98.02.83.82.96.0

The results above show that in general DataNucleus 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 DataNucleus with PostgreSQL database server (6.0) reveals that in these tests, DataNucleus with PostgreSQL server is 2.1 times faster than DataNucleus with H2 server.

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 DataNucleus with H2 database server (2.6) to the normalized speed of DataNucleus with PostgreSQL database server (13.2) reveals that in that case, DataNucleus with PostgreSQL server is 5.1 times faster than DataNucleus with H2 server.

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

Other Head to Head DBMS/JPA Comparisons