Compare with

Comparison of Hibernate with HSQLDB embedded 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
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test32.63.813.13.022.93.4
Element Collection Test15.12.08.21.311.71.7
Inheritance Test25.53.413.63.019.53.2
Indexing Test29.64.818.84.124.24.4
Graph (Binary Tree) Test13.81.815.61.614.71.7
Multithreading Test37.46.913.03.925.25.4
All Tests25.63.813.72.819.73.3

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

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 HSQLDB embedded database (15.6) reveals that in that case, Hibernate with HSQLDB embedded is 9.8 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
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test24.83.816.48.420.66.1
Element Collection Test11.31.010.81.011.01.0
Inheritance Test21.73.521.09.721.36.6
Indexing Test11.93.221.59.516.76.4
Graph (Binary Tree) Test3.60.914.71.24.11.1
Multithreading Test19.87.821.513.420.610.6
All Tests15.53.416.07.215.75.3

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test3.634.00.884.12.219.1
Element Collection Test3.433.81.70.642.617.2
Inheritance Test2.920.51.05.01.912.8
Indexing Test9.92.021.79.215.85.6
Multithreading Test1.136.20.585.10.8220.6
All Tests4.225.35.24.84.715.1

The results above show that in general Hibernate with Derby server is much more efficient than Hibernate with HSQLDB embedded in executing the tested JPA queries. Comparing the normalized speed of Hibernate with HSQLDB embedded database (4.7) to the normalized speed of Hibernate with Derby database server (15.1) reveals that in these tests, Hibernate with Derby server is 3.2 times faster than Hibernate with HSQLDB embedded.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with HSQLDB embedded database (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 HSQLDB embedded.

On the other hand, Hibernate with Derby server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with Derby database server (2.0) to the normalized speed of Hibernate with HSQLDB embedded database (9.9) reveals that in that case, Hibernate with Derby server is 5.0 times slower than Hibernate with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test14.22.95.02.59.62.7
Element Collection Test10.12.35.61.57.81.9
Inheritance Test13.42.97.53.510.53.2
Indexing Test10.73.06.14.28.43.6
Graph (Binary Tree) Test3.71.22.50.583.10.91
Multithreading Test23.96.83.82.513.94.6
All Tests12.73.25.12.58.92.8

The results above show that in general Hibernate with HSQLDB embedded is much more efficient than Hibernate with Derby server in updating JPA entity objects in the database. Comparing the normalized speed of Hibernate with Derby database server (2.8) to the normalized speed of Hibernate with HSQLDB embedded database (8.9) reveals that in these tests, Hibernate with HSQLDB embedded is 3.2 times faster than Hibernate with Derby server.

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of Hibernate with Derby database server (2.9) to the normalized speed of Hibernate with HSQLDB embedded database (14.2) reveals that in that case, Hibernate with HSQLDB embedded is 4.9 times faster than Hibernate with Derby server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test26.12.917.53.521.83.2
Element Collection Test9.11.75.20.877.11.3
Inheritance Test21.42.917.73.619.63.2
Indexing Test33.03.716.33.624.73.7
Graph (Binary Tree) Test5.40.698.20.706.80.70
Multithreading Test38.56.228.65.133.55.6
All Tests22.33.015.62.918.93.0

The results above show that in general Hibernate with HSQLDB embedded is much more efficient than Hibernate with Derby server in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with Derby database server (3.0) to the normalized speed of Hibernate with HSQLDB embedded database (18.9) reveals that in these tests, Hibernate with HSQLDB embedded is 6.3 times faster than Hibernate with Derby server.

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with Derby database server (0.70) to the normalized speed of Hibernate with HSQLDB embedded database (8.2) reveals that in that case, Hibernate with HSQLDB embedded is 11.7 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
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Hibernate
HSQLDB embedded
Hibernate
Derby server
Basic Person Test20.29.510.64.315.46.9
Element Collection Test9.88.26.31.18.04.6
Inheritance Test17.06.612.25.014.65.8
Indexing Test19.03.316.96.118.04.7
Graph (Binary Tree) Test6.61.27.81.07.21.1
Multithreading Test24.112.813.56.018.89.4
All Tests16.57.111.34.013.95.6

The results above show that in general Hibernate with HSQLDB embedded is more efficient than Hibernate with Derby server in performing JPA database operations. Comparing the normalized speed of Hibernate with Derby database server (5.6) to the normalized speed of Hibernate with HSQLDB embedded database (13.9) reveals that in these tests, Hibernate with HSQLDB embedded is 2.5 times faster than Hibernate with Derby server.

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of Hibernate with Derby database server (1.0) to the normalized speed of Hibernate with HSQLDB embedded database (7.8) reveals that in that case, Hibernate with HSQLDB embedded is 7.8 times faster than Hibernate with Derby server.

Other Head to Head DBMS/JPA Comparisons