Compare with

Comparison of Hibernate with H2 server 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 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test4.64.63.02.83.83.7
Element Collection Test3.72.41.11.62.42.0
Inheritance Test6.74.63.12.74.93.7
Indexing Test8.27.64.24.86.26.2
Graph (Binary Tree) Test3.41.63.91.43.71.5
Multithreading Test6.88.65.03.35.95.9
All Tests5.64.93.42.84.53.8

The results above show that in general Hibernate with H2 server is slightly more efficient than DataNucleus with Derby embedded in persisting JPA entity objects to 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 Derby embedded database (1.4) to the normalized speed of Hibernate with H2 database server (3.9) reveals that in that case, Hibernate with H2 server is 2.8 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 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test3.16.86.014.94.610.9
Element Collection Test1.05.41.17.61.06.5
Inheritance Test2.98.87.614.85.211.8
Indexing Test2.69.27.014.14.811.6
Graph (Binary Tree) Test0.429.91.115.80.7812.9
Multithreading Test6.511.910.511.58.511.7
All Tests2.88.75.613.14.210.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test3.739.11.07.52.323.3
Element Collection Test3.746.00.636.72.226.3
Inheritance Test3.27.71.43.82.35.7
Indexing Test1.70.0535.88.03.84.0
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.723.21.96.52.314.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 server in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 database server (2.3) to the normalized speed of DataNucleus with Derby embedded database (14.8) reveals that in these tests, DataNucleus with Derby embedded is 6.4 times faster than Hibernate with H2 server.

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

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 database server (1.7) reveals that in that case, DataNucleus with Derby embedded is 32.1 times slower than Hibernate with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test2.94.01.83.82.43.9
Element Collection Test2.63.71.14.51.94.1
Inheritance Test3.24.42.54.82.94.6
Indexing Test2.95.22.74.22.84.7
Graph (Binary Tree) Test1.22.70.431.50.792.1
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.14.01.83.72.53.9

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test3.83.52.41.33.12.4
Element Collection Test1.91.91.11.61.51.7
Inheritance Test3.72.42.51.33.11.9
Indexing Test7.66.63.11.95.34.3
Graph (Binary Tree) Test0.990.810.910.930.950.87
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.03.02.91.43.52.2

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Hibernate
H2 server
DataNucleus
Derby embedded
Basic Person Test3.611.62.86.13.28.8
Element Collection Test2.611.91.04.41.88.1
Inheritance Test4.05.63.45.53.75.5
Indexing Test4.65.74.56.64.66.2
Graph (Binary Tree) Test1.53.71.64.91.64.3
Multithreading Test5.210.35.27.45.28.8
All Tests3.78.03.25.73.46.9

The results above show that in general DataNucleus with Derby embedded is more efficient than Hibernate with H2 server in performing JPA database operations. Comparing the normalized speed of Hibernate with H2 database server (3.4) to the normalized speed of DataNucleus with Derby embedded database (6.9) reveals that in these tests, DataNucleus with Derby embedded is 2.0 times faster than Hibernate with H2 server.

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

Other Head to Head DBMS/JPA Comparisons