Compare with

Comparison of DataNucleus with PostgreSQL server vs OpenJPA 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
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test4.113.32.66.93.310.1
Element Collection Test0.918.60.385.30.647.0
Inheritance Test3.812.22.45.83.19.0
Indexing Test6.016.76.49.16.212.9
Graph (Binary Tree) Test0.916.10.777.30.846.7
Multithreading Test18.026.88.37.013.116.9
All Tests5.613.93.56.94.510.4

The results above show that in general OpenJPA with HSQLDB embedded is more efficient than DataNucleus with PostgreSQL server in persisting JPA entity objects to the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (4.5) to the normalized speed of OpenJPA with HSQLDB embedded database (10.4) reveals that in these tests, OpenJPA with HSQLDB embedded is 2.3 times faster than DataNucleus with PostgreSQL server.

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test1.721.87.630.14.625.9
Element Collection Test0.730.00680.634.50.682.2
Inheritance Test1.50.00259.32.05.40.98
Indexing Test1.522.19.243.65.332.9
Graph (Binary Tree) Test2.62.112.32.17.42.1
Multithreading Test3.420.910.823.57.122.2
All Tests1.911.18.317.65.114.4

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

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.5) to the normalized speed of OpenJPA with HSQLDB embedded database (22.1) reveals that in that case, OpenJPA with HSQLDB embedded is 14.7 times faster than DataNucleus 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 DataNucleus with PostgreSQL database server (1.5) reveals that in that case, OpenJPA with HSQLDB embedded is 600 times slower than DataNucleus with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test49.12.84.70.9126.91.9
Element Collection Test39.11.40.480.9519.81.2
Inheritance Test55.92.46.61.331.21.8
Indexing Test0.04815.46.434.33.224.9
Multithreading Testfailed1.4failed0.53failed0.95
All Tests36.04.74.57.620.36.1

DataNucleus with PostgreSQL server has failed in 2 tests (see exceptions).

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

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (1.4) to the normalized speed of DataNucleus with PostgreSQL database server (39.1) reveals that in that case, DataNucleus with PostgreSQL server is 27.9 times faster than OpenJPA with HSQLDB embedded.

On the other hand, DataNucleus with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.048) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, DataNucleus with PostgreSQL server is 321 times slower than OpenJPA with HSQLDB embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test2.112.00.845.31.58.6
Element Collection Test1.40.0170.643.71.01.8
Inheritance Test2.10.00981.22.01.70.99
Indexing Test2.29.31.55.51.87.4
Graph (Binary Tree) Test0.652.50.201.60.422.1
Multithreading Test0.4620.0failed3.70.4611.8
All Tests1.57.30.873.61.25.5

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than DataNucleus with PostgreSQL server in updating JPA entity objects in the database. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.2) to the normalized speed of OpenJPA with HSQLDB embedded database (5.5) reveals that in these tests, OpenJPA with HSQLDB embedded is 4.6 times faster than DataNucleus with PostgreSQL server.

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.46) to the normalized speed of OpenJPA with HSQLDB embedded database (20.0) reveals that in that case, OpenJPA with HSQLDB embedded is 43.5 times faster than DataNucleus 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 DataNucleus with PostgreSQL database server (2.1) reveals that in that case, OpenJPA with HSQLDB embedded is 214 times slower than DataNucleus with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test3.021.31.315.72.218.5
Element Collection Test1.00.0110.392.90.691.5
Inheritance Test2.80.00701.33.52.11.8
Indexing Test5.428.81.915.23.722.0
Graph (Binary Tree) Test0.382.90.373.60.373.2
Multithreading Test13.826.0failed19.613.822.8
All Tests4.413.21.110.12.911.6

DataNucleus with PostgreSQL server has failed in 1 tests (see exceptions).

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

A huge performance gap has been detected when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (1.3) to the normalized speed of OpenJPA with HSQLDB embedded database (15.7) reveals that in that case, OpenJPA with HSQLDB embedded is 12.1 times faster than DataNucleus 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 DataNucleus with PostgreSQL database server (2.8) reveals that in that case, OpenJPA with HSQLDB embedded is 400 times slower than DataNucleus with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
DataNucleus
PostgreSQL server
OpenJPA
HSQLDB embedded
Basic Person Test12.014.33.411.87.713.0
Element Collection Test8.62.00.503.54.62.7
Inheritance Test13.22.94.22.98.72.9
Indexing Test3.018.55.121.64.020.0
Graph (Binary Tree) Test1.13.43.43.72.33.5
Multithreading Test8.919.09.510.99.114.9
All Tests8.010.23.89.26.09.7

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

A large performance gap has been detected when using JPA element collections with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with PostgreSQL database server (0.50) to the normalized speed of OpenJPA with HSQLDB embedded database (3.5) reveals that in that case, OpenJPA with HSQLDB embedded is 7.0 times faster than DataNucleus 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/retrieval size. Comparing the normalized speed of OpenJPA with HSQLDB embedded database (2.9) to the normalized speed of DataNucleus with PostgreSQL database server (13.2) reveals that in that case, OpenJPA with HSQLDB embedded is 4.6 times slower than DataNucleus with PostgreSQL server.

Other Head to Head DBMS/JPA Comparisons