Compare with

Comparison of Hibernate with SQLite embedded vs Hibernate with H2 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
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.08318.11.09.00.5513.5
Element Collection Test0.06713.00.696.80.389.9
Inheritance Test0.08021.00.999.40.5415.2
Indexing Test0.09829.91.018.40.5524.1
Graph (Binary Tree) Test0.2717.20.9620.10.6118.7
Multithreading Testfailed36.9failed11.5failed24.2
All Tests0.1222.60.9312.50.5317.6

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

The results above show that in general Hibernate with H2 embedded 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 embedded database (17.6) reveals that in these tests, Hibernate with H2 embedded is 33.2 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 H2 embedded database (29.9) reveals that in that case, Hibernate with H2 embedded is 305 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 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test1.816.61.313.31.515.0
Element Collection Test0.00084.3failed4.00.00084.1
Inheritance Test2.410.41.417.51.913.9
Indexing Test1.910.82.315.22.113.0
Graph (Binary Tree) Test0.562.50.884.00.723.3
Multithreading Testfailed16.2failed15.7failed15.9
All Tests1.310.11.511.61.410.9

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

The results above show that in general Hibernate with H2 embedded 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 embedded database (10.9) reveals that in these tests, Hibernate with H2 embedded is 7.8 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 embedded database (4.3) reveals that in that case, Hibernate with H2 embedded is 5,375 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 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test1.14.50.221.20.652.8
Element Collection Test0.394.4failed1.40.392.9
Inheritance Test0.533.10.281.50.402.3
Indexing Test0.00116.60.4310.50.218.6
Multithreading Testfailed1.2failed0.59failed0.89
All Tests0.504.00.313.00.423.5

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

The results above show that in general Hibernate with H2 embedded 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 embedded database (3.5) reveals that in these tests, Hibernate with H2 embedded is 8.3 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 embedded database (6.6) reveals that in that case, Hibernate with H2 embedded is 6,000 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 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.07612.10.656.50.379.3
Element Collection Test0.00227.4failed5.30.00226.3
Inheritance Test0.07910.80.978.50.539.6
Indexing Test0.05710.00.547.50.308.8
Graph (Binary Tree) Test0.264.40.422.30.343.4
Multithreading Testfailed16.2failed4.0failed10.1
All Tests0.09410.10.655.70.347.9

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

The results above show that in general Hibernate with H2 embedded 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 embedded database (7.9) reveals that in these tests, Hibernate with H2 embedded is 23.2 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 embedded database (7.4) reveals that in that case, Hibernate with H2 embedded is 3,364 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 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.06119.70.9111.40.4915.5
Element Collection Test0.00076.9failed4.50.00075.7
Inheritance Test0.05815.60.9012.90.4814.2
Indexing Test0.07923.20.5412.40.3117.8
Graph (Binary Tree) Test0.244.00.804.20.524.1
Multithreading Testfailed27.4failed22.7failed25.0
All Tests0.08816.10.7911.40.4013.7

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

The results above show that in general Hibernate with H2 embedded 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 embedded database (13.7) reveals that in these tests, Hibernate with H2 embedded is 34.2 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 embedded database (6.9) reveals that in that case, Hibernate with H2 embedded is 9,857 times faster than Hibernate with SQLite embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test90.227.090.227.090.227.0
Element Collection Test82.030.682.030.682.030.6
Inheritance Test80.527.080.527.080.527.0
Indexing Test93.431.694.832.194.131.9
Graph (Binary Tree) Test67.928.550.921.459.425.0
Multithreading Testfailed33.9failed9.2failed21.5
All Tests82.829.879.724.681.227.2

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

The results above show that in general Hibernate with SQLite embedded is more efficient than Hibernate with H2 embedded in using disk space. Comparing the normalized score of Hibernate with H2 embedded database (27.2) to the normalized score of Hibernate with SQLite embedded database (81.2) reveals that in these tests, Hibernate with SQLite embedded is 3.0 times more efficient than Hibernate with H2 embedded.

A large gap has been detected when using simple basic entities with small transaction size. Comparing the normalized score of Hibernate with H2 embedded database (27.0) to the normalized score of Hibernate with SQLite embedded database (90.2) reveals that in that case, Hibernate with SQLite embedded is 3.3 times more efficient than Hibernate with H2 embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.6314.20.818.30.7211.2
Element Collection Test0.0927.20.694.40.195.8
Inheritance Test0.6312.20.919.90.7711.0
Indexing Test0.4216.10.9612.80.6914.5
Graph (Binary Tree) Test0.337.00.777.70.557.3
Multithreading Testfailed19.6failed10.9failed15.2
All Tests0.4212.90.869.00.6211.0

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

Other Head to Head DBMS/JPA Comparisons