Compare with

Comparison of Hibernate with SQLite 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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test0.0833.61.01.60.552.6
Element Collection Test0.0671.60.690.720.381.1
Inheritance Test0.0803.70.991.60.542.7
Indexing Test0.0985.41.02.60.554.0
Graph (Binary Tree) Test0.271.50.961.20.611.4
Multithreading Testfailed7.4failed2.9failed5.2
All Tests0.123.90.931.80.532.8

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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test1.83.01.311.01.57.0
Element Collection Test0.00080.34failed1.20.00080.79
Inheritance Test2.41.31.414.51.97.9
Indexing Test1.92.52.312.82.17.6
Graph (Binary Tree) Test0.560.550.880.710.720.63
Multithreading Testfailed0.23failed13.8failed7.0
All Tests1.31.31.59.01.45.2

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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test1.110.00.222.00.656.0
Element Collection Test0.396.7failed0.530.393.6
Inheritance Test0.532.80.281.60.402.2
Indexing Test0.00110.440.432.00.211.2
Multithreading Testfailed2.1failed0.98failed1.5
All Tests0.504.40.311.40.422.9

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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test0.0760.730.651.60.371.2
Element Collection Test0.00220.39failed1.20.00220.78
Inheritance Test0.0790.610.972.10.531.4
Indexing Test0.0570.810.542.60.301.7
Graph (Binary Tree) Test0.260.690.420.400.340.54
Multithreading Testfailed0.63failed3.0failed1.8
All Tests0.0940.640.651.80.341.2

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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test0.0611.10.911.70.491.4
Element Collection Test0.00070.21failed0.530.00070.37
Inheritance Test0.0580.650.901.80.481.2
Indexing Test0.0790.810.542.00.311.4
Graph (Binary Tree) Test0.240.550.800.620.520.58
Multithreading Testfailed0.35failed4.1failed2.2
All Tests0.0880.610.791.80.401.2

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
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Hibernate
SQLite embedded
Hibernate
MySQL server
Basic Person Test0.633.70.813.60.723.6
Element Collection Test0.0921.80.690.840.191.3
Inheritance Test0.631.80.914.30.773.1
Indexing Test0.422.00.964.40.693.2
Graph (Binary Tree) Test0.330.830.770.730.550.78
Multithreading Testfailed2.1failed5.0failed3.6
All Tests0.422.10.863.20.622.7

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