Compare with

Comparison of Hibernate with H2 server vs DataNucleus with Derby 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
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test4.62.83.02.33.82.6
Element Collection Test3.70.711.10.352.40.53
Inheritance Test6.72.73.12.04.92.3
Indexing Test8.24.54.24.06.24.3
Graph (Binary Tree) Test3.40.623.90.533.70.57
Multithreading Test6.84.95.03.45.94.1
All Tests5.62.73.42.14.52.4

The results above show that in general Hibernate with H2 server is more efficient than DataNucleus with Derby server 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 database server (0.53) to the normalized speed of Hibernate with H2 database server (3.9) reveals that in that case, Hibernate with H2 server is 7.4 times faster than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test3.10.566.06.34.63.4
Element Collection Test1.00.361.10.931.00.64
Inheritance Test2.90.457.66.85.23.6
Indexing Test2.60.507.07.14.83.8
Graph (Binary Tree) Test0.420.221.16.60.783.4
Multithreading Test6.51.210.510.08.55.6
All Tests2.80.555.66.34.23.4

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

A large performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.45) to the normalized speed of Hibernate with H2 database server (2.9) reveals that in that case, Hibernate with H2 server is 6.4 times faster than DataNucleus with Derby server.

On the other hand, Hibernate with H2 server is slower, for instance, when using graphs of objects with large retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.1) to the normalized speed of DataNucleus with Derby database server (6.6) reveals that in that case, Hibernate with H2 server is 6.0 times slower than DataNucleus with Derby server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test3.737.71.03.62.320.7
Element Collection Test3.725.90.631.42.213.6
Inheritance Test3.26.51.41.82.34.2
Indexing Test1.70.0305.84.93.82.5
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.717.51.92.92.310.2

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

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

A huge performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (3.7) to the normalized speed of DataNucleus with Derby database server (37.7) reveals that in that case, DataNucleus with Derby server is 10.2 times faster than Hibernate with H2 server.

On the other hand, DataNucleus with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.030) to the normalized speed of Hibernate with H2 database server (1.7) reveals that in that case, DataNucleus with Derby server is 56.7 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 server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test2.91.11.80.852.40.99
Element Collection Test2.60.811.10.621.90.71
Inheritance Test3.21.22.51.32.91.2
Indexing Test2.91.22.71.52.81.3
Graph (Binary Tree) Test1.20.290.430.410.790.35
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.10.931.80.922.50.92

DataNucleus with Derby server 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 server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with Derby database server (0.92) to the normalized speed of Hibernate with H2 database server (2.5) reveals that in these tests, Hibernate with H2 server is 2.7 times faster than DataNucleus with Derby server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test3.81.32.41.33.11.3
Element Collection Test1.90.611.10.331.50.47
Inheritance Test3.71.02.51.33.11.2
Indexing Test7.62.33.11.95.32.1
Graph (Binary Tree) Test0.990.260.910.460.950.36
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.01.12.91.13.51.1

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

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Basic Person Test3.68.72.82.93.25.8
Element Collection Test2.65.71.00.721.83.2
Inheritance Test4.02.43.42.63.72.5
Indexing Test4.61.74.53.94.62.8
Graph (Binary Tree) Test1.50.351.62.01.61.2
Multithreading Test5.23.05.26.75.24.9
All Tests3.73.83.22.83.43.3

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

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

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

Other Head to Head DBMS/JPA Comparisons