Compare with

Comparison of Hibernate with SQLite embedded vs Hibernate with H2 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test0.0834.61.03.00.553.8
Element Collection Test0.0673.70.691.10.382.4
Inheritance Test0.0806.70.993.10.544.9
Indexing Test0.0988.21.04.20.556.2
Graph (Binary Tree) Test0.273.40.963.90.613.7
Multithreading Testfailed6.8failed5.0failed5.9
All Tests0.125.60.933.40.534.5

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

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.080) to the normalized speed of Hibernate with H2 database server (6.7) reveals that in that case, Hibernate with H2 server is 83.8 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test1.83.11.36.01.54.6
Element Collection Test0.00081.0failed1.10.00081.0
Inheritance Test2.42.91.47.61.95.2
Indexing Test1.92.62.37.02.14.8
Graph (Binary Tree) Test0.560.420.881.10.720.78
Multithreading Testfailed6.5failed10.5failed8.5
All Tests1.32.81.55.61.44.2

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

The results above show that in general Hibernate with H2 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 H2 database server (4.2) reveals that in these tests, Hibernate with H2 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 retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.0008) to the normalized speed of Hibernate with H2 database server (1.0) reveals that in that case, Hibernate with H2 server is 1,250 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test1.13.70.221.00.652.3
Element Collection Test0.393.7failed0.630.392.2
Inheritance Test0.533.20.281.40.402.3
Indexing Test0.00111.70.435.80.213.8
Multithreading Testfailed1.1failed0.88failed1.0
All Tests0.502.70.311.90.422.3

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

The results above show that in general Hibernate with H2 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 H2 database server (2.3) reveals that in these tests, Hibernate with H2 server is 5.5 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 H2 database server (1.7) reveals that in that case, Hibernate with H2 server is 1,545 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test0.0762.90.651.80.372.4
Element Collection Test0.00222.6failed1.10.00221.9
Inheritance Test0.0793.20.972.50.532.9
Indexing Test0.0572.90.542.70.302.8
Graph (Binary Tree) Test0.261.20.420.430.340.79
Multithreading Testfailed5.6failed2.4failed4.0
All Tests0.0943.10.651.80.342.5

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

The results above show that in general Hibernate with H2 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 H2 database server (2.5) reveals that in these tests, Hibernate with H2 server is 7.4 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 H2 database server (2.6) reveals that in that case, Hibernate with H2 server is 1,182 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test0.0613.80.912.40.493.1
Element Collection Test0.00071.9failed1.10.00071.5
Inheritance Test0.0583.70.902.50.483.1
Indexing Test0.0797.60.543.10.315.3
Graph (Binary Tree) Test0.240.990.800.910.520.95
Multithreading Testfailed6.1failed7.3failed6.7
All Tests0.0884.00.792.90.403.5

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

The results above show that in general Hibernate with H2 server is much 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 H2 database server (3.5) reveals that in these tests, Hibernate with H2 server is 8.8 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 H2 database server (1.9) reveals that in that case, Hibernate with H2 server is 2,714 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Basic Person Test0.633.60.812.80.723.2
Element Collection Test0.0922.60.691.00.191.8
Inheritance Test0.634.00.913.40.773.7
Indexing Test0.424.60.964.50.694.6
Graph (Binary Tree) Test0.331.50.771.60.551.6
Multithreading Testfailed5.2failed5.2failed5.2
All Tests0.423.70.863.20.623.4

The results above show that in general Hibernate with H2 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 H2 database server (3.4) reveals that in these tests, Hibernate with H2 server is 5.5 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 H2 database server (2.6) reveals that in that case, Hibernate with H2 server is 28.3 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons