Compare with

Comparison of Hibernate with SQLite embedded vs Hibernate with PostgreSQL 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
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test0.0837.11.03.40.555.2
Element Collection Test0.0672.90.691.70.382.3
Inheritance Test0.0807.00.993.60.545.3
Indexing Test0.0989.31.06.10.557.7
Graph (Binary Tree) Test0.273.00.962.90.612.9
Multithreading Testfailed31.7failed13.9failed22.8
All Tests0.1210.20.935.30.537.7

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
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test1.85.51.311.51.58.5
Element Collection Test0.00080.025failed0.0170.00080.021
Inheritance Test2.45.21.414.01.99.6
Indexing Test1.94.62.313.32.18.9
Graph (Binary Tree) Test0.560.610.880.780.720.70
Multithreading Testfailed11.3failed17.0failed14.2
All Tests1.34.51.59.41.47.0

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
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test1.155.50.226.10.6530.8
Element Collection Test0.3911.0failed0.0160.395.5
Inheritance Test0.5352.30.288.70.4030.5
Indexing Test0.00110.0500.438.80.214.4
Multithreading Testfailed55.2failed9.2failed32.2
All Tests0.5034.80.316.60.4220.7

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
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test0.0765.30.652.70.374.0
Element Collection Test0.00220.067failed0.0260.00220.046
Inheritance Test0.0795.40.973.80.534.6
Indexing Test0.0575.40.544.30.304.8
Graph (Binary Tree) Test0.261.10.420.580.340.82
Multithreading Testfailed29.6failed6.3failed18.0
All Tests0.0947.80.652.90.345.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 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
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test0.0615.30.914.20.494.8
Element Collection Test0.00070.020failedstopped0.00070.0098
Inheritance Test0.0585.10.904.20.484.6
Indexing Test0.0799.50.546.30.317.9
Graph (Binary Tree) Test0.240.0120.800.0120.520.012
Multithreading Testfailed23.3failed21.8failed22.5
All Tests0.0887.20.796.10.406.6

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
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Hibernate
SQLite embedded
Hibernate
PostgreSQL server
Basic Person Test0.6315.70.815.60.7210.7
Element Collection Test0.0922.80.690.350.191.6
Inheritance Test0.6315.00.916.90.7710.9
Indexing Test0.425.80.967.80.696.8
Graph (Binary Tree) Test0.331.20.771.10.551.1
Multithreading Testfailed30.2failed13.6failed21.9
All Tests0.4212.10.866.00.629.1

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