Compare with

Comparison of Hibernate with Derby server vs DataNucleus with H2 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
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test3.83.43.02.23.42.8
Element Collection Test2.01.21.30.641.70.92
Inheritance Test3.43.03.01.93.22.4
Indexing Test4.85.34.13.54.44.4
Graph (Binary Tree) Test1.82.11.61.31.71.7
Multithreading Test6.910.03.94.35.47.2
All Tests3.84.22.82.33.33.2

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with H2 database server (0.64) to the normalized speed of Hibernate with Derby database server (1.3) reveals that in that case, Hibernate with Derby server is 2.0 times faster than DataNucleus with H2 server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test3.82.58.45.26.13.9
Element Collection Test1.00.561.01.11.00.82
Inheritance Test3.52.29.76.16.64.2
Indexing Test3.22.19.57.76.44.9
Graph (Binary Tree) Test0.915.71.28.91.17.3
Multithreading Test7.82.313.48.710.65.5
All Tests3.42.57.26.35.34.4

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

A large performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (2.3) to the normalized speed of Hibernate with Derby database server (7.8) reveals that in that case, Hibernate with Derby server is 3.4 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with Derby server is slower, for instance, 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 database server (8.9) reveals that in that case, Hibernate with Derby server is 7.4 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
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test34.04.14.11.319.12.7
Element Collection Test33.84.00.640.4917.22.3
Inheritance Test20.52.95.01.512.82.2
Indexing Test2.00.00369.21.55.60.75
Multithreading Test36.21.35.1failed20.61.3
All Tests25.32.54.81.215.11.9

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

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (0.0036) to the normalized speed of Hibernate with Derby database server (2.0) reveals that in that case, Hibernate with Derby server is 556 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
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test2.92.52.51.42.71.9
Element Collection Test2.32.01.51.01.91.5
Inheritance Test2.92.43.52.33.22.3
Indexing Test3.02.74.23.03.62.9
Graph (Binary Tree) Test1.21.80.580.600.911.2
Multithreading Test6.8failed2.5failed4.6failed
All Tests3.22.32.51.72.82.0

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test2.93.43.51.33.22.3
Element Collection Test1.71.50.870.681.31.1
Inheritance Test2.92.73.61.33.22.0
Indexing Test3.75.73.61.93.73.8
Graph (Binary Tree) Test0.691.50.701.20.701.3
Multithreading Test6.2failed5.15.15.65.1
All Tests3.03.02.91.93.02.4

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

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

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 H2 database server (1.3) to the normalized speed of Hibernate with Derby database server (3.6) reveals that in that case, Hibernate with Derby server is 2.8 times faster than DataNucleus with H2 server.

On the other hand, Hibernate with Derby server is slower, for instance, 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 database server (1.5) reveals that in that case, Hibernate with Derby server is 2.2 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
 Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Hibernate
Derby server
DataNucleus
H2 server
Basic Person Test9.53.24.32.36.92.7
Element Collection Test8.21.91.10.784.61.3
Inheritance Test6.62.65.02.65.82.6
Indexing Test3.33.26.13.54.73.3
Graph (Binary Tree) Test1.22.81.03.01.12.9
Multithreading Test12.84.56.06.09.45.3
All Tests7.12.94.02.85.62.9

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

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

On the other hand, Hibernate with Derby server is slower, for instance, 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 database server (3.0) reveals that in that case, Hibernate with Derby server is 3.0 times slower than DataNucleus with H2 server.

Other Head to Head DBMS/JPA Comparisons