Compare with

Comparison of DataNucleus with PostgreSQL server vs DataNucleus with H2 embedded

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
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test4.119.22.68.03.313.6
Element Collection Test0.916.60.382.80.644.7
Inheritance Test3.815.62.44.43.110.0
Indexing Test6.024.46.411.86.218.1
Graph (Binary Tree) Test0.919.20.776.20.847.7
Multithreading Test18.034.98.37.113.121.0
All Tests5.618.33.56.74.512.5

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test1.713.27.613.54.613.3
Element Collection Test0.736.40.638.90.687.7
Inheritance Test1.512.29.312.75.412.4
Indexing Test1.58.19.216.55.312.3
Graph (Binary Tree) Test2.610.612.320.97.415.8
Multithreading Test3.413.310.89.97.111.6
All Tests1.910.68.313.75.112.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test49.14.74.71.426.93.1
Element Collection Test39.15.00.482.419.83.7
Inheritance Test55.93.86.61.631.22.7
Indexing Test0.0480.00416.41.83.20.91
Multithreading Testfailed1.2failed0.79failed1.0
All Tests36.03.04.51.620.32.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 DataNucleus with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 embedded database (2.3) to the normalized speed of DataNucleus with PostgreSQL database server (20.3) reveals that in these tests, DataNucleus with PostgreSQL server is 8.8 times faster than DataNucleus with H2 embedded.

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

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.48) to the normalized speed of DataNucleus with H2 embedded database (2.4) reveals that in that case, DataNucleus with PostgreSQL server is 5.0 times slower than DataNucleus with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test2.110.00.843.91.56.9
Element Collection Test1.47.60.643.91.05.8
Inheritance Test2.19.41.24.41.76.9
Indexing Test2.210.61.55.91.88.2
Graph (Binary Tree) Test0.655.90.203.70.424.8
Multithreading Test0.46failedfailedfailed0.46failed
All Tests1.58.70.874.41.26.5

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

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

A huge 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 embedded database (3.7) reveals that in that case, DataNucleus with H2 embedded is 18.5 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
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test3.04.21.31.32.22.8
Element Collection Test1.04.90.391.60.693.2
Inheritance Test2.84.01.31.32.12.7
Indexing Test5.47.51.91.93.74.7
Graph (Binary Tree) Test0.385.60.374.10.374.8
Multithreading Test13.8failedfailedfailed13.8failed
All Tests4.45.21.12.02.93.6

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
DataNucleus
PostgreSQL server
DataNucleus
H2 embedded
Basic Person Test12.010.33.45.67.77.9
Element Collection Test8.66.10.503.94.65.0
Inheritance Test13.29.04.24.98.76.9
Indexing Test3.010.15.17.64.08.9
Graph (Binary Tree) Test1.17.83.48.72.38.3
Multithreading Test8.916.59.55.99.111.2
All Tests8.09.63.86.06.07.8

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

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

Other Head to Head DBMS/JPA Comparisons