Compare with

Comparison of Hibernate with H2 server vs Hibernate 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
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test4.63.83.03.03.83.4
Element Collection Test3.72.01.11.32.41.7
Inheritance Test6.73.43.13.04.93.2
Indexing Test8.24.84.24.16.24.4
Graph (Binary Tree) Test3.41.83.91.63.71.7
Multithreading Test6.86.95.03.95.95.4
All Tests5.63.83.42.84.53.3

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test3.13.86.08.44.66.1
Element Collection Test1.01.01.11.01.01.0
Inheritance Test2.93.57.69.75.26.6
Indexing Test2.63.27.09.54.86.4
Graph (Binary Tree) Test0.420.911.11.20.781.1
Multithreading Test6.57.810.513.48.510.6
All Tests2.83.45.67.24.25.3

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

A large 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 Hibernate with Derby database server (0.91) reveals that in that case, Hibernate with Derby server is 2.2 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
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test3.734.01.04.12.319.1
Element Collection Test3.733.80.630.642.217.2
Inheritance Test3.220.51.45.02.312.8
Indexing Test1.72.05.89.23.85.6
Multithreading Test1.136.20.885.11.020.6
All Tests2.725.31.94.82.315.1

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with H2 database server (1.1) to the normalized speed of Hibernate with Derby database server (36.2) reveals that in that case, Hibernate with Derby server is 32.9 times faster 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
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test2.92.91.82.52.42.7
Element Collection Test2.62.31.11.51.91.9
Inheritance Test3.22.92.53.52.93.2
Indexing Test2.93.02.74.22.83.6
Graph (Binary Tree) Test1.21.20.430.580.790.91
Multithreading Test5.66.82.42.54.04.6
All Tests3.13.21.82.52.52.8

The results above show that in general Hibernate with Derby server is slightly more efficient than Hibernate 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
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test3.82.92.43.53.13.2
Element Collection Test1.91.71.10.871.51.3
Inheritance Test3.72.92.53.63.13.2
Indexing Test7.63.73.13.65.33.7
Graph (Binary Tree) Test0.990.690.910.700.950.70
Multithreading Test6.16.27.35.16.75.6
All Tests4.03.02.92.93.53.0

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

A large performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (3.7) to the normalized speed of Hibernate with H2 database server (7.6) reveals that in that case, Hibernate with H2 server is 2.1 times faster than Hibernate with Derby server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Hibernate
H2 server
Hibernate
Derby server
Basic Person Test3.69.52.84.33.26.9
Element Collection Test2.68.21.01.11.84.6
Inheritance Test4.06.63.45.03.75.8
Indexing Test4.63.34.56.14.64.7
Graph (Binary Tree) Test1.51.21.61.01.61.1
Multithreading Test5.212.85.26.05.29.4
All Tests3.77.13.24.03.45.6

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

Other Head to Head DBMS/JPA Comparisons