Compare with

Comparison of OpenJPA with HSQLDB embedded vs OpenJPA 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
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test13.35.26.94.810.15.0
Element Collection Test8.62.85.32.27.02.5
Inheritance Test12.24.65.83.29.03.9
Indexing Test16.77.49.16.912.97.1
Graph (Binary Tree) Test6.10.987.30.816.70.89
Multithreading Test26.823.47.09.116.916.2
All Tests13.97.46.94.510.45.9

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

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.81) to the normalized speed of OpenJPA with HSQLDB embedded database (7.3) reveals that in that case, OpenJPA with HSQLDB embedded is 9.0 times faster than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test21.85.830.116.125.910.9
Element Collection Test0.00680.0134.58.72.24.4
Inheritance Test0.00255.22.017.60.9811.4
Indexing Test22.14.843.618.732.911.8
Graph (Binary Tree) Test2.10.272.10.352.10.31
Multithreading Test20.911.923.523.322.217.6
All Tests11.14.717.614.114.49.4

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

A large performance gap has been detected when using graphs of objects with small retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.27) to the normalized speed of OpenJPA with HSQLDB embedded database (2.1) reveals that in that case, OpenJPA with HSQLDB embedded is 7.8 times faster than OpenJPA with PostgreSQL server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0025) to the normalized speed of OpenJPA with PostgreSQL database server (5.2) reveals that in that case, OpenJPA with HSQLDB embedded is 2,080 times slower than OpenJPA with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test2.8failed0.91failed1.9failed
Element Collection Test1.4failed0.95failed1.2failed
Inheritance Test2.4failed1.3failed1.8failed
Indexing Test15.4failed34.3failed24.9failed
Multithreading Test1.4failed0.53failed0.95failed
All Tests4.7failed7.6failed6.1failed

OpenJPA with PostgreSQL server has failed in 10 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test12.04.95.33.98.64.4
Element Collection Test0.0170.0333.74.61.82.3
Inheritance Test0.00984.82.04.90.994.9
Indexing Test9.35.15.56.07.45.6
Graph (Binary Tree) Test2.50.571.60.312.10.44
Multithreading Test20.022.23.77.411.814.8
All Tests7.36.33.64.55.55.4

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

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.31) to the normalized speed of OpenJPA with HSQLDB embedded database (1.6) reveals that in that case, OpenJPA with HSQLDB embedded is 5.2 times faster than OpenJPA with PostgreSQL server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0098) to the normalized speed of OpenJPA with PostgreSQL database server (4.8) reveals that in that case, OpenJPA with HSQLDB embedded is 490 times slower than OpenJPA with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test21.34.615.75.318.55.0
Element Collection Test0.0110.0322.92.81.51.4
Inheritance Test0.00704.33.54.61.84.4
Indexing Test28.88.015.27.122.07.5
Graph (Binary Tree) Test2.90.533.60.553.20.54
Multithreading Test26.017.419.69.122.813.3
All Tests13.25.810.14.911.65.4

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than OpenJPA with PostgreSQL server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with PostgreSQL database server (5.4) to the normalized speed of OpenJPA with HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.1 times faster than OpenJPA with PostgreSQL server.

A large performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.55) to the normalized speed of OpenJPA with HSQLDB embedded database (3.6) reveals that in that case, OpenJPA with HSQLDB embedded is 6.5 times faster than OpenJPA with PostgreSQL server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with small transaction size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (0.0070) to the normalized speed of OpenJPA with PostgreSQL database server (4.3) reveals that in that case, OpenJPA with HSQLDB embedded is 614 times slower than OpenJPA with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
OpenJPA
HSQLDB embedded
OpenJPA
PostgreSQL server
Basic Person Test14.35.111.87.513.06.3
Element Collection Test2.00.723.54.62.72.6
Inheritance Test2.94.72.97.62.96.2
Indexing Test18.56.321.69.720.08.0
Graph (Binary Tree) Test3.40.593.70.503.50.55
Multithreading Test19.018.710.912.214.915.5
All Tests10.26.09.27.09.76.5

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

A large performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with PostgreSQL database server (0.50) to the normalized speed of OpenJPA with HSQLDB embedded database (3.7) reveals that in that case, OpenJPA with HSQLDB embedded is 7.4 times faster than OpenJPA with PostgreSQL server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, when using class inheritance in the object model with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (2.9) to the normalized speed of OpenJPA with PostgreSQL database server (7.6) reveals that in that case, OpenJPA with HSQLDB embedded is 2.6 times slower than OpenJPA with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons