Compare with

Comparison of Hibernate with H2 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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test4.60.0833.01.03.80.55
Element Collection Test3.70.0671.10.692.40.38
Inheritance Test6.70.0803.10.994.90.54
Indexing Test8.20.0984.21.06.20.55
Graph (Binary Tree) Test3.40.273.90.963.70.61
Multithreading Test6.8failed5.0failed5.9failed
All Tests5.60.123.40.934.50.53

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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test3.11.86.01.34.61.5
Element Collection Test1.00.00081.1failed1.00.0008
Inheritance Test2.92.47.61.45.21.9
Indexing Test2.61.97.02.34.82.1
Graph (Binary Tree) Test0.420.561.10.880.780.72
Multithreading Test6.5failed10.5failed8.5failed
All Tests2.81.35.61.54.21.4

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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test3.71.11.00.222.30.65
Element Collection Test3.70.390.63failed2.20.39
Inheritance Test3.20.531.40.282.30.40
Indexing Test1.70.00115.80.433.80.21
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.70.501.90.312.30.42

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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test2.90.0761.80.652.40.37
Element Collection Test2.60.00221.1failed1.90.0022
Inheritance Test3.20.0792.50.972.90.53
Indexing Test2.90.0572.70.542.80.30
Graph (Binary Tree) Test1.20.260.430.420.790.34
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.10.0941.80.652.50.34

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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test3.80.0612.40.913.10.49
Element Collection Test1.90.00071.1failed1.50.0007
Inheritance Test3.70.0582.50.903.10.48
Indexing Test7.60.0793.10.545.30.31
Graph (Binary Tree) Test0.990.240.910.800.950.52
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.00.0882.90.793.50.40

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
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Hibernate
H2 server
Hibernate
SQLite embedded
Basic Person Test3.60.632.80.813.20.72
Element Collection Test2.60.0921.00.691.80.19
Inheritance Test4.00.633.40.913.70.77
Indexing Test4.60.424.50.964.60.69
Graph (Binary Tree) Test1.50.331.60.771.60.55
Multithreading Test5.2failed5.2failed5.2failed
All Tests3.70.423.20.863.40.62

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