Compare with

Comparison of Hibernate with H2 embedded vs DataNucleus with Derby 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
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test18.14.69.02.813.53.7
Element Collection Test13.02.46.81.69.92.0
Inheritance Test21.04.69.42.715.23.7
Indexing Test29.97.618.44.824.16.2
Graph (Binary Tree) Test17.21.620.11.418.71.5
Multithreading Test36.98.611.53.324.25.9
All Tests22.64.912.52.817.63.8

The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with Derby embedded in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with Derby embedded database (3.8) to the normalized speed of Hibernate with H2 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 4.6 times faster than DataNucleus with Derby embedded.

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.4) to the normalized speed of Hibernate with H2 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 14.4 times faster than DataNucleus with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test16.66.813.314.915.010.9
Element Collection Test4.35.44.07.64.16.5
Inheritance Test10.48.817.514.813.911.8
Indexing Test10.89.215.214.113.011.6
Graph (Binary Tree) Test2.59.94.015.83.312.9
Multithreading Test16.211.915.711.515.911.7
All Tests10.18.711.613.110.910.9

The results above show that in general DataNucleus with Derby embedded is equivalent to Hibernate with H2 embedded in retrieving JPA entity objects from the database.

A large performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (2.5) to the normalized speed of DataNucleus with Derby embedded database (9.9) reveals that in that case, DataNucleus with Derby embedded is 4.0 times faster than Hibernate with H2 embedded.

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using simple basic entities with small retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (6.8) to the normalized speed of Hibernate with H2 embedded database (16.6) reveals that in that case, DataNucleus with Derby embedded is 2.4 times slower than Hibernate with H2 embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test4.539.11.27.52.823.3
Element Collection Test4.446.01.46.72.926.3
Inheritance Test3.17.71.53.82.35.7
Indexing Test6.60.05310.58.08.64.0
Multithreading Test1.2failed0.59failed0.89failed
All Tests4.023.23.06.53.514.8

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

The results above show that in general DataNucleus with Derby embedded is much more efficient than Hibernate with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 embedded database (3.5) to the normalized speed of DataNucleus with Derby embedded database (14.8) reveals that in these tests, DataNucleus with Derby embedded is 4.2 times faster than Hibernate with H2 embedded.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of Hibernate with H2 embedded database (4.4) to the normalized speed of DataNucleus with Derby embedded database (46.0) reveals that in that case, DataNucleus with Derby embedded is 10.5 times faster than Hibernate with H2 embedded.

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (0.053) to the normalized speed of Hibernate with H2 embedded database (6.6) reveals that in that case, DataNucleus with Derby embedded is 125 times slower than Hibernate with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test12.14.06.53.89.33.9
Element Collection Test7.43.75.34.56.34.1
Inheritance Test10.84.48.54.89.64.6
Indexing Test10.05.27.54.28.84.7
Graph (Binary Tree) Test4.42.72.31.53.42.1
Multithreading Test16.2failed4.0failed10.1failed
All Tests10.14.05.73.77.93.9

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

The results above show that in general Hibernate with H2 embedded is more efficient than DataNucleus with Derby embedded in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby embedded database (3.9) to the normalized speed of Hibernate with H2 embedded database (7.9) reveals that in these tests, Hibernate with H2 embedded is 2.0 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (4.0) to the normalized speed of Hibernate with H2 embedded database (12.1) reveals that in that case, Hibernate with H2 embedded is 3.0 times faster than DataNucleus with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test19.73.511.41.315.52.4
Element Collection Test6.91.94.51.65.71.7
Inheritance Test15.62.412.91.314.21.9
Indexing Test23.26.612.41.917.84.3
Graph (Binary Tree) Test4.00.814.20.934.10.87
Multithreading Test27.4failed22.7failed25.0failed
All Tests16.13.011.41.413.72.2

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

The results above show that in general Hibernate with H2 embedded is much more efficient than DataNucleus with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with Derby embedded database (2.2) to the normalized speed of Hibernate with H2 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 6.2 times faster than DataNucleus with Derby embedded.

A large performance gap has been detected when using class inheritance in the object model with large transaction size. Comparing the normalized speed of DataNucleus with Derby embedded database (1.3) to the normalized speed of Hibernate with H2 embedded database (12.9) reveals that in that case, Hibernate with H2 embedded is 9.9 times faster than DataNucleus with Derby embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test27.053.327.053.327.053.3
Element Collection Test30.642.630.642.630.642.6
Inheritance Test27.048.127.048.127.048.1
Indexing Test31.662.332.163.331.962.8
Graph (Binary Tree) Test28.513.621.410.225.011.9
Multithreading Test33.952.09.28.021.530.0
All Tests29.845.324.637.627.241.5

The results above show that in general DataNucleus with Derby embedded is more efficient than Hibernate with H2 embedded in using disk space.

On the other hand, DataNucleus with Derby embedded is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized score of DataNucleus with Derby embedded database (10.2) to the normalized score of Hibernate with H2 embedded database (21.4) reveals that in that case, DataNucleus with Derby embedded is 2.1 times less efficient than Hibernate with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Hibernate
H2 embedded
DataNucleus
Derby embedded
Basic Person Test14.211.68.36.111.28.8
Element Collection Test7.211.94.44.45.88.1
Inheritance Test12.25.69.95.511.05.5
Indexing Test16.15.712.86.614.56.2
Graph (Binary Tree) Test7.03.77.74.97.34.3
Multithreading Test19.610.310.97.415.28.8
All Tests12.98.09.05.711.06.9

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

A large performance gap has been detected when using database indexes with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with Derby embedded database (5.7) to the normalized speed of Hibernate with H2 embedded database (16.1) reveals that in that case, Hibernate with H2 embedded is 2.8 times faster than DataNucleus with Derby embedded.

Other Head to Head DBMS/JPA Comparisons