Compare with

Comparison of Hibernate with Derby embedded vs Hibernate with MySQL 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
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test5.93.63.81.64.92.6
Element Collection Test2.91.61.80.722.31.1
Inheritance Test5.33.73.71.64.52.7
Indexing Test7.05.44.82.65.94.0
Graph (Binary Tree) Test1.91.51.71.21.81.4
Multithreading Test10.57.43.72.97.15.2
All Tests5.63.93.31.84.42.8

The results above show that in general Hibernate with Derby embedded is more efficient than Hibernate with MySQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.72) to the normalized speed of Hibernate with Derby embedded database (1.8) reveals that in that case, Hibernate with Derby embedded is 2.5 times faster than Hibernate with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test14.23.016.411.015.37.0
Element Collection Test4.40.344.91.24.60.79
Inheritance Test10.31.318.614.514.47.9
Indexing Test10.02.516.412.813.27.6
Graph (Binary Tree) Test2.60.553.00.712.80.63
Multithreading Test19.30.2319.313.819.37.0
All Tests10.11.313.19.011.65.2

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (0.23) to the normalized speed of Hibernate with Derby embedded database (19.3) reveals that in that case, Hibernate with Derby embedded is 83.9 times faster than Hibernate with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test49.310.06.82.028.16.0
Element Collection Test37.66.72.70.5320.13.6
Inheritance Test24.12.87.61.615.92.2
Indexing Test5.30.4414.82.010.11.2
Multithreading Test39.72.16.10.9822.91.5
All Tests31.24.47.61.419.42.9

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

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (2.1) to the normalized speed of Hibernate with Derby embedded database (39.7) reveals that in that case, Hibernate with Derby embedded is 18.9 times faster than Hibernate with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test4.50.733.21.63.81.2
Element Collection Test3.90.393.11.23.50.78
Inheritance Test4.60.614.52.14.51.4
Indexing Test4.60.815.52.65.11.7
Graph (Binary Tree) Test2.70.691.20.402.00.54
Multithreading Test11.60.632.63.07.11.8
All Tests5.30.643.31.84.31.2

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.63) to the normalized speed of Hibernate with Derby embedded database (11.6) reveals that in that case, Hibernate with Derby embedded is 18.4 times faster than Hibernate with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test3.81.14.21.74.01.4
Element Collection Test2.30.211.50.531.90.37
Inheritance Test4.00.654.31.84.21.2
Indexing Test5.50.813.62.04.61.4
Graph (Binary Tree) Test0.740.550.960.620.850.58
Multithreading Test5.60.354.94.15.32.2
All Tests3.70.613.31.83.51.2

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

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.35) to the normalized speed of Hibernate with Derby embedded database (5.6) reveals that in that case, Hibernate with Derby embedded is 16.0 times faster than Hibernate with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Hibernate
Derby embedded
Hibernate
MySQL server
Basic Person Test15.53.76.93.611.23.6
Element Collection Test10.21.82.80.846.51.3
Inheritance Test9.71.87.74.38.73.1
Indexing Test6.52.09.04.47.83.2
Graph (Binary Tree) Test2.00.831.70.731.80.78
Multithreading Test17.32.17.35.012.33.6
All Tests10.52.16.13.28.32.7

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

A large performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (2.1) to the normalized speed of Hibernate with Derby embedded database (17.3) reveals that in that case, Hibernate with Derby embedded is 8.2 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons