Compare with

Comparison of DataNucleus with Derby server vs Hibernate 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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test2.84.62.33.02.63.8
Element Collection Test0.713.70.351.10.532.4
Inheritance Test2.76.72.03.12.34.9
Indexing Test4.58.24.04.24.36.2
Graph (Binary Tree) Test0.623.40.533.90.573.7
Multithreading Test4.96.83.45.04.15.9
All Tests2.75.62.13.42.44.5

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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test0.563.16.36.03.44.6
Element Collection Test0.361.00.931.10.641.0
Inheritance Test0.452.96.87.63.65.2
Indexing Test0.502.67.17.03.84.8
Graph (Binary Tree) Test0.220.426.61.13.40.78
Multithreading Test1.26.510.010.55.68.5
All Tests0.552.86.35.63.44.2

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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test37.73.73.61.020.72.3
Element Collection Test25.93.71.40.6313.62.2
Inheritance Test6.53.21.81.44.22.3
Indexing Test0.0301.74.95.82.53.8
Multithreading Testfailed1.1failed0.88failed1.0
All Tests17.52.72.91.910.22.3

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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test1.12.90.851.80.992.4
Element Collection Test0.812.60.621.10.711.9
Inheritance Test1.23.21.32.51.22.9
Indexing Test1.22.91.52.71.32.8
Graph (Binary Tree) Test0.291.20.410.430.350.79
Multithreading Testfailed5.6failed2.4failed4.0
All Tests0.933.10.921.80.922.5

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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test1.33.81.32.41.33.1
Element Collection Test0.611.90.331.10.471.5
Inheritance Test1.03.71.32.51.23.1
Indexing Test2.37.61.93.12.15.3
Graph (Binary Tree) Test0.260.990.460.910.360.95
Multithreading Testfailed6.1failed7.3failed6.7
All Tests1.14.01.12.91.13.5

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
 DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
DataNucleus
Derby server
Hibernate
H2 server
Basic Person Test8.73.62.92.85.83.2
Element Collection Test5.72.60.721.03.21.8
Inheritance Test2.44.02.63.42.53.7
Indexing Test1.74.63.94.52.84.6
Graph (Binary Tree) Test0.351.52.01.61.21.6
Multithreading Test3.05.26.75.24.95.2
All Tests3.83.72.83.23.33.4

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