Compare with

Comparison of Hibernate with MySQL server vs Hibernate with SQLite embedded

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
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.60.0831.61.02.60.55
Element Collection Test1.60.0670.720.691.10.38
Inheritance Test3.70.0801.60.992.70.54
Indexing Test5.40.0982.61.04.00.55
Graph (Binary Tree) Test1.50.271.20.961.40.61
Multithreading Test7.4failed2.9failed5.2failed
All Tests3.90.121.80.932.80.53

Hibernate with SQLite embedded has failed in 2 tests (see exceptions).

The results above show that in general Hibernate with MySQL server is much more efficient than Hibernate with SQLite embedded in persisting JPA entity objects to the database. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of Hibernate with MySQL database server (2.8) reveals that in these tests, Hibernate with MySQL server is 5.3 times faster than Hibernate with SQLite embedded.

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.098) to the normalized speed of Hibernate with MySQL database server (5.4) reveals that in that case, Hibernate with MySQL server is 55.1 times faster than Hibernate with SQLite embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.01.811.01.37.01.5
Element Collection Test0.340.00081.2failed0.790.0008
Inheritance Test1.32.414.51.47.91.9
Indexing Test2.51.912.82.37.62.1
Graph (Binary Tree) Test0.550.560.710.880.630.72
Multithreading Test0.23failed13.8failed7.0failed
All Tests1.31.39.01.55.21.4

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test10.01.12.00.226.00.65
Element Collection Test6.70.390.53failed3.60.39
Inheritance Test2.80.531.60.282.20.40
Indexing Test0.440.00112.00.431.20.21
Multithreading Test2.1failed0.98failed1.5failed
All Tests4.40.501.40.312.90.42

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0011) to the normalized speed of Hibernate with MySQL database server (0.44) reveals that in that case, Hibernate with MySQL server is 400 times faster than Hibernate with SQLite embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test0.730.0761.60.651.20.37
Element Collection Test0.390.00221.2failed0.780.0022
Inheritance Test0.610.0792.10.971.40.53
Indexing Test0.810.0572.60.541.70.30
Graph (Binary Tree) Test0.690.260.400.420.540.34
Multithreading Test0.63failed3.0failed1.8failed
All Tests0.640.0941.80.651.20.34

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0022) to the normalized speed of Hibernate with MySQL database server (0.39) reveals that in that case, Hibernate with MySQL server is 177 times faster than Hibernate with SQLite embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test1.10.0611.70.911.40.49
Element Collection Test0.210.00070.53failed0.370.0007
Inheritance Test0.650.0581.80.901.20.48
Indexing Test0.810.0792.00.541.40.31
Graph (Binary Tree) Test0.550.240.620.800.580.52
Multithreading Test0.35failed4.1failed2.2failed
All Tests0.610.0881.80.791.20.40

Hibernate with SQLite embedded has failed in 3 tests (see exceptions).

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

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0007) to the normalized speed of Hibernate with MySQL database server (0.21) reveals that in that case, Hibernate with MySQL server is 300 times faster than Hibernate with SQLite embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Basic Person Test3.70.633.60.813.60.72
Element Collection Test1.80.0920.840.691.30.19
Inheritance Test1.80.634.30.913.10.77
Indexing Test2.00.424.40.963.20.69
Graph (Binary Tree) Test0.830.330.730.770.780.55
Multithreading Test2.1failed5.0failed3.6failed
All Tests2.10.423.20.862.70.62

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

A huge performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.092) to the normalized speed of Hibernate with MySQL database server (1.8) reveals that in that case, Hibernate with MySQL server is 19.6 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons