Compare with

Comparison of Hibernate with PostgreSQL server vs DataNucleus with HSQLDB 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
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test7.114.23.44.85.29.5
Element Collection Test2.96.61.72.12.34.3
Inheritance Test7.013.63.64.65.39.1
Indexing Test9.324.66.111.17.717.8
Graph (Binary Tree) Test3.06.82.94.52.95.7
Multithreading Test31.738.513.98.522.823.5
All Tests10.217.45.35.97.711.7

The results above show that in general DataNucleus with HSQLDB embedded is more efficient than Hibernate with PostgreSQL server in persisting JPA entity objects to the database.

A large performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (9.3) to the normalized speed of DataNucleus with HSQLDB embedded database (24.6) reveals that in that case, DataNucleus with HSQLDB embedded is 2.6 times faster than Hibernate with PostgreSQL server.

Speed comparison of JPA database retrieval operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.56.611.510.28.58.4
Element Collection Test0.0253.60.0178.10.0215.8
Inheritance Test5.25.714.08.89.67.2
Indexing Test4.65.113.39.58.97.3
Graph (Binary Tree) Test0.617.20.789.30.708.3
Multithreading Test11.38.117.09.514.28.8
All Tests4.56.09.49.27.07.6

The results above show that in general DataNucleus with HSQLDB embedded is slightly more efficient than Hibernate with PostgreSQL server in retrieving JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.017) to the normalized speed of DataNucleus with HSQLDB embedded database (8.1) reveals that in that case, DataNucleus with HSQLDB embedded is 476 times faster than Hibernate with PostgreSQL server.

Speed comparison of JPA database query operations (normalized score, higher is better)

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test55.51.46.10.4830.80.95
Element Collection Test11.01.30.0160.675.51.0
Inheritance Test52.31.68.70.6130.51.1
Indexing Test0.0500.00168.80.634.40.32
Multithreading Test55.20.409.2failed32.20.40
All Tests34.80.966.60.6020.70.80

DataNucleus with HSQLDB embedded has failed in 1 tests (see exceptions).

The results above show that in general Hibernate with PostgreSQL server is much more efficient than DataNucleus with HSQLDB embedded in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (0.80) to the normalized speed of Hibernate with PostgreSQL database server (20.7) reveals that in these tests, Hibernate with PostgreSQL server is 25.9 times faster than DataNucleus with HSQLDB embedded.

A huge performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (0.40) to the normalized speed of Hibernate with PostgreSQL database server (55.2) reveals that in that case, Hibernate with PostgreSQL server is 138 times faster than DataNucleus with HSQLDB embedded.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.016) to the normalized speed of DataNucleus with HSQLDB embedded database (0.67) reveals that in that case, Hibernate with PostgreSQL server is 41.9 times slower than DataNucleus with HSQLDB embedded.

Speed comparison of JPA database update operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.311.52.72.74.07.1
Element Collection Test0.0676.90.0262.70.0464.8
Inheritance Test5.410.33.83.64.66.9
Indexing Test5.411.44.34.44.87.9
Graph (Binary Tree) Test1.13.50.581.50.822.5
Multithreading Test29.6failed6.3failed18.0failed
All Tests7.88.72.93.05.45.8

DataNucleus with HSQLDB embedded has failed in 2 tests (see exceptions).

The results above show that in general DataNucleus with HSQLDB embedded is slightly more efficient than Hibernate with PostgreSQL server in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.026) to the normalized speed of DataNucleus with HSQLDB embedded database (2.7) reveals that in that case, DataNucleus with HSQLDB embedded is 104 times faster than Hibernate with PostgreSQL server.

Speed comparison of JPA database removal operations (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test5.34.24.21.34.82.8
Element Collection Test0.0204.9stopped1.60.00983.2
Inheritance Test5.14.04.21.34.62.7
Indexing Test9.57.56.31.97.94.7
Graph (Binary Tree) Test0.0122.90.0122.00.0122.5
Multithreading Test23.340.121.813.722.526.9
All Tests7.210.66.13.76.67.1

The results above show that in general DataNucleus with HSQLDB embedded is slightly more efficient than Hibernate with PostgreSQL server in deleting JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.020) to the normalized speed of DataNucleus with HSQLDB embedded database (4.9) reveals that in that case, DataNucleus with HSQLDB embedded is 245 times faster than Hibernate with PostgreSQL server.

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using database indexes with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.9) to the normalized speed of Hibernate with PostgreSQL database server (6.3) reveals that in that case, DataNucleus with HSQLDB embedded is 3.3 times slower than Hibernate with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Hibernate
PostgreSQL server
DataNucleus
HSQLDB embedded
Basic Person Test15.77.65.63.910.75.7
Element Collection Test2.84.70.353.01.63.8
Inheritance Test15.07.16.93.810.95.4
Indexing Test5.89.77.85.56.87.6
Graph (Binary Tree) Test1.25.11.14.31.14.7
Multithreading Test30.221.813.610.621.917.0
All Tests12.19.06.04.89.17.0

The results above show that in general Hibernate with PostgreSQL server is more efficient than DataNucleus with HSQLDB embedded in performing JPA database operations.

A large performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (7.1) to the normalized speed of Hibernate with PostgreSQL database server (15.0) reveals that in that case, Hibernate with PostgreSQL server is 2.1 times faster than DataNucleus with HSQLDB embedded.

On the other hand, Hibernate with PostgreSQL server is slower, for instance, when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of Hibernate with PostgreSQL database server (0.35) to the normalized speed of DataNucleus with HSQLDB embedded database (3.0) reveals that in that case, Hibernate with PostgreSQL server is 8.6 times slower than DataNucleus with HSQLDB embedded.

Other Head to Head DBMS/JPA Comparisons