Compare with

Comparison of Hibernate with Derby 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
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test3.819.23.08.03.413.6
Element Collection Test2.06.61.32.81.74.7
Inheritance Test3.415.63.04.43.210.0
Indexing Test4.824.44.111.84.418.1
Graph (Binary Tree) Test1.89.21.66.21.77.7
Multithreading Test6.934.93.97.15.421.0
All Tests3.818.32.86.73.312.5

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test3.813.28.413.56.113.3
Element Collection Test1.06.41.08.91.07.7
Inheritance Test3.512.29.712.76.612.4
Indexing Test3.28.19.516.56.412.3
Graph (Binary Tree) Test0.9110.61.220.91.115.8
Multithreading Test7.813.313.49.910.611.6
All Tests3.410.67.213.75.312.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test34.04.74.11.419.13.1
Element Collection Test33.85.00.642.417.23.7
Inheritance Test20.53.85.01.612.82.7
Indexing Test2.00.00419.21.85.60.91
Multithreading Test36.21.25.10.7920.61.0
All Tests25.33.04.81.615.12.3

The results above show that in general Hibernate with Derby 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 Hibernate with Derby database server (15.1) reveals that in these tests, Hibernate with Derby server is 6.6 times faster than DataNucleus with H2 embedded.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (0.0041) to the normalized speed of Hibernate with Derby database server (2.0) reveals that in that case, Hibernate with Derby server is 488 times faster than DataNucleus with H2 embedded.

On the other hand, Hibernate with Derby server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with Derby database server (0.64) to the normalized speed of DataNucleus with H2 embedded database (2.4) reveals that in that case, Hibernate with Derby server is 3.8 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
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test2.910.02.53.92.76.9
Element Collection Test2.37.61.53.91.95.8
Inheritance Test2.99.43.54.43.26.9
Indexing Test3.010.64.25.93.68.2
Graph (Binary Tree) Test1.25.90.583.70.914.8
Multithreading Test6.8failed2.5failed4.6failed
All Tests3.28.72.54.42.86.5

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test2.94.23.51.33.22.8
Element Collection Test1.74.90.871.61.33.2
Inheritance Test2.94.03.61.33.22.7
Indexing Test3.77.53.61.93.74.7
Graph (Binary Tree) Test0.695.60.704.10.704.8
Multithreading Test6.2failed5.1failed5.6failed
All Tests3.05.22.92.03.03.6

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 Hibernate with Derby server in deleting JPA entity objects from the database.

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Hibernate
Derby server
DataNucleus
H2 embedded
Basic Person Test9.510.34.35.66.97.9
Element Collection Test8.26.11.13.94.65.0
Inheritance Test6.69.05.04.95.86.9
Indexing Test3.310.16.17.64.78.9
Graph (Binary Tree) Test1.27.81.08.71.18.3
Multithreading Test12.816.56.05.99.411.2
All Tests7.19.64.06.05.67.8

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

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

Other Head to Head DBMS/JPA Comparisons