Compare with

Comparison of Hibernate with H2 embedded 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 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test18.12.89.02.313.52.6
Element Collection Test13.00.716.80.359.90.53
Inheritance Test21.02.79.42.015.22.3
Indexing Test29.94.518.44.024.14.3
Graph (Binary Tree) Test17.20.6220.10.5318.70.57
Multithreading Test36.94.911.53.424.24.1
All Tests22.62.712.52.117.62.4

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

A huge 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 embedded database (20.1) reveals that in that case, Hibernate with H2 embedded is 37.9 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 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test16.60.5613.36.315.03.4
Element Collection Test4.30.364.00.934.10.64
Inheritance Test10.40.4517.56.813.93.6
Indexing Test10.80.5015.27.113.03.8
Graph (Binary Tree) Test2.50.224.06.63.33.4
Multithreading Test16.21.215.710.015.95.6
All Tests10.10.5511.66.310.93.4

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

A huge performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of DataNucleus with Derby database server (0.56) to the normalized speed of Hibernate with H2 embedded database (16.6) reveals that in that case, Hibernate with H2 embedded is 29.6 times faster 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 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test4.537.71.23.62.820.7
Element Collection Test4.425.91.41.42.913.6
Inheritance Test3.16.51.51.82.34.2
Indexing Test6.60.03010.54.98.62.5
Multithreading Test1.2failed0.59failed0.89failed
All Tests4.017.53.02.93.510.2

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

The results above show that in general DataNucleus with Derby server is more efficient than Hibernate with H2 embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with H2 embedded database (3.5) to the normalized speed of DataNucleus with Derby database server (10.2) reveals that in these tests, DataNucleus with Derby server is 2.9 times faster than Hibernate with H2 embedded.

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test12.11.16.50.859.30.99
Element Collection Test7.40.815.30.626.30.71
Inheritance Test10.81.28.51.39.61.2
Indexing Test10.01.27.51.58.81.3
Graph (Binary Tree) Test4.40.292.30.413.40.35
Multithreading Test16.2failed4.0failed10.1failed
All Tests10.10.935.70.927.90.92

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

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

A huge 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 embedded database (4.4) reveals that in that case, Hibernate with H2 embedded is 15.2 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 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test19.71.311.41.315.51.3
Element Collection Test6.90.614.50.335.70.47
Inheritance Test15.61.012.91.314.21.2
Indexing Test23.22.312.41.917.82.1
Graph (Binary Tree) Test4.00.264.20.464.10.36
Multithreading Test27.4failed22.7failed25.0failed
All Tests16.11.111.41.113.71.1

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

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of DataNucleus with Derby database server (1.0) to the normalized speed of Hibernate with H2 embedded database (15.6) reveals that in that case, Hibernate with H2 embedded is 15.6 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 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Hibernate
H2 embedded
DataNucleus
Derby server
Basic Person Test14.28.78.32.911.25.8
Element Collection Test7.25.74.40.725.83.2
Inheritance Test12.22.49.92.611.02.5
Indexing Test16.11.712.83.914.52.8
Graph (Binary Tree) Test7.00.357.72.07.31.2
Multithreading Test19.63.010.96.715.24.9
All Tests12.93.89.02.811.03.3

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

A huge 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 embedded database (7.0) reveals that in that case, Hibernate with H2 embedded is 20.0 times faster than DataNucleus with Derby server.

Other Head to Head DBMS/JPA Comparisons