Compare with

Comparison of Hibernate with PostgreSQL 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test7.10.0833.41.05.20.55
Element Collection Test2.90.0671.70.692.30.38
Inheritance Test7.00.0803.60.995.30.54
Indexing Test9.30.0986.11.07.70.55
Graph (Binary Tree) Test3.00.272.90.962.90.61
Multithreading Test31.7failed13.9failed22.8failed
All Tests10.20.125.30.937.70.53

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

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (7.7) reveals that in these tests, Hibernate with PostgreSQL server is 14.5 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 PostgreSQL database server (9.3) reveals that in that case, Hibernate with PostgreSQL server is 94.9 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.51.811.51.38.51.5
Element Collection Test0.0250.00080.017failed0.0210.0008
Inheritance Test5.22.414.01.49.61.9
Indexing Test4.61.913.32.38.92.1
Graph (Binary Tree) Test0.610.560.780.880.700.72
Multithreading Test11.3failed17.0failed14.2failed
All Tests4.51.39.41.57.01.4

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

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (7.0) reveals that in these tests, Hibernate with PostgreSQL server is 5.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 PostgreSQL database server (0.025) reveals that in that case, Hibernate with PostgreSQL server is 31.2 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test55.51.16.10.2230.80.65
Element Collection Test11.00.390.016failed5.50.39
Inheritance Test52.30.538.70.2830.50.40
Indexing Test0.0500.00118.80.434.40.21
Multithreading Test55.2failed9.2failed32.2failed
All Tests34.80.506.60.3120.70.42

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

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

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of Hibernate with SQLite embedded database (0.53) to the normalized speed of Hibernate with PostgreSQL database server (52.3) reveals that in that case, Hibernate with PostgreSQL server is 98.7 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.30.0762.70.654.00.37
Element Collection Test0.0670.00220.026failed0.0460.0022
Inheritance Test5.40.0793.80.974.60.53
Indexing Test5.40.0574.30.544.80.30
Graph (Binary Tree) Test1.10.260.580.420.820.34
Multithreading Test29.6failed6.3failed18.0failed
All Tests7.80.0942.90.655.40.34

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

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (5.4) reveals that in these tests, Hibernate with PostgreSQL server is 15.9 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.057) to the normalized speed of Hibernate with PostgreSQL database server (5.4) reveals that in that case, Hibernate with PostgreSQL server is 94.7 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test5.30.0614.20.914.80.49
Element Collection Test0.0200.0007stoppedfailed0.00980.0007
Inheritance Test5.10.0584.20.904.60.48
Indexing Test9.50.0796.30.547.90.31
Graph (Binary Tree) Test0.0120.240.0120.800.0120.52
Multithreading Test23.3failed21.8failed22.5failed
All Tests7.20.0886.10.796.60.40

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

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (6.6) reveals that in these tests, Hibernate with PostgreSQL server is 16.5 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.079) to the normalized speed of Hibernate with PostgreSQL database server (9.5) reveals that in that case, Hibernate with PostgreSQL server is 120 times faster than Hibernate with SQLite embedded.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using graphs of objects with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.012) to the normalized speed of Hibernate with SQLite embedded database (0.80) reveals that in that case, Hibernate with PostgreSQL server is 66.7 times slower than Hibernate with SQLite embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Basic Person Test15.70.635.60.8110.70.72
Element Collection Test2.80.0920.350.691.60.19
Inheritance Test15.00.636.90.9110.90.77
Indexing Test5.80.427.80.966.80.69
Graph (Binary Tree) Test1.20.331.10.771.10.55
Multithreading Test30.2failed13.6failed21.9failed
All Tests12.10.426.00.869.10.62

The results above show that in general Hibernate with PostgreSQL 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 PostgreSQL database server (9.1) reveals that in these tests, Hibernate with PostgreSQL server is 14.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 PostgreSQL database server (2.8) reveals that in that case, Hibernate with PostgreSQL server is 30.4 times faster than Hibernate with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons