Compare with

Comparison of Hibernate with H2 embedded 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 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test18.10.0839.01.013.50.55
Element Collection Test13.00.0676.80.699.90.38
Inheritance Test21.00.0809.40.9915.20.54
Indexing Test29.90.09818.41.024.10.55
Graph (Binary Tree) Test17.20.2720.10.9618.70.61
Multithreading Test36.9failed11.5failed24.2failed
All Tests22.60.1212.50.9317.60.53

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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test16.61.813.31.315.01.5
Element Collection Test4.30.00084.0failed4.10.0008
Inheritance Test10.42.417.51.413.91.9
Indexing Test10.81.915.22.313.02.1
Graph (Binary Tree) Test2.50.564.00.883.30.72
Multithreading Test16.2failed15.7failed15.9failed
All Tests10.11.311.61.510.91.4

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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test4.51.11.20.222.80.65
Element Collection Test4.40.391.4failed2.90.39
Inheritance Test3.10.531.50.282.30.40
Indexing Test6.60.001110.50.438.60.21
Multithreading Test1.2failed0.59failed0.89failed
All Tests4.00.503.00.313.50.42

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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test12.10.0766.50.659.30.37
Element Collection Test7.40.00225.3failed6.30.0022
Inheritance Test10.80.0798.50.979.60.53
Indexing Test10.00.0577.50.548.80.30
Graph (Binary Tree) Test4.40.262.30.423.40.34
Multithreading Test16.2failed4.0failed10.1failed
All Tests10.10.0945.70.657.90.34

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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test19.70.06111.40.9115.50.49
Element Collection Test6.90.00074.5failed5.70.0007
Inheritance Test15.60.05812.90.9014.20.48
Indexing Test23.20.07912.40.5417.80.31
Graph (Binary Tree) Test4.00.244.20.804.10.52
Multithreading Test27.4failed22.7failed25.0failed
All Tests16.10.08811.40.7913.70.40

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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test27.090.227.090.227.090.2
Element Collection Test30.682.030.682.030.682.0
Inheritance Test27.080.527.080.527.080.5
Indexing Test31.693.432.194.831.994.1
Graph (Binary Tree) Test28.567.921.450.925.059.4
Multithreading Test33.9failed9.2failed21.5failed
All Tests29.882.824.679.727.281.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
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Hibernate
H2 embedded
Hibernate
SQLite embedded
Basic Person Test14.20.638.30.8111.20.72
Element Collection Test7.20.0924.40.695.80.19
Inheritance Test12.20.639.90.9111.00.77
Indexing Test16.10.4212.80.9614.50.69
Graph (Binary Tree) Test7.00.337.70.777.30.55
Multithreading Test19.6failed10.9failed15.2failed
All Tests12.90.429.00.8611.00.62

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