Compare with

Comparison of OpenJPA with HSQLDB embedded vs DataNucleus with H2 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
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test13.33.46.92.210.12.8
Element Collection Test8.61.25.30.647.00.92
Inheritance Test12.23.05.81.99.02.4
Indexing Test16.75.39.13.512.94.4
Graph (Binary Tree) Test6.12.17.31.36.71.7
Multithreading Test26.810.07.04.316.97.2
All Tests13.94.26.92.310.43.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test21.82.530.15.225.93.9
Element Collection Test0.00680.564.51.12.20.82
Inheritance Test0.00252.22.06.10.984.2
Indexing Test22.12.143.67.732.94.9
Graph (Binary Tree) Test2.15.72.18.92.17.3
Multithreading Test20.92.323.58.722.25.5
All Tests11.12.517.66.314.44.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test2.84.10.911.31.92.7
Element Collection Test1.44.00.950.491.22.3
Inheritance Test2.42.91.31.51.82.2
Indexing Test15.40.003634.31.524.90.75
Multithreading Test1.41.30.53failed0.951.3
All Tests4.72.57.61.26.11.9

DataNucleus with H2 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 H2 server in executing the tested JPA queries. Comparing the normalized speed of DataNucleus with H2 database server (1.9) to the normalized speed of OpenJPA with HSQLDB embedded database (6.1) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.2 times faster than DataNucleus with H2 server.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (0.0036) to the normalized speed of OpenJPA with HSQLDB embedded database (15.4) reveals that in that case, OpenJPA with HSQLDB embedded is 4,278 times faster than DataNucleus with H2 server.

On the other hand, OpenJPA with HSQLDB embedded is slower, for instance, 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 H2 database server (4.0) reveals that in that case, OpenJPA with HSQLDB embedded is 2.9 times slower than DataNucleus with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test12.02.55.31.48.61.9
Element Collection Test0.0172.03.71.01.81.5
Inheritance Test0.00982.42.02.30.992.3
Indexing Test9.32.75.53.07.42.9
Graph (Binary Tree) Test2.51.81.60.602.11.2
Multithreading Test20.0failed3.7failed11.8failed
All Tests7.32.33.61.75.52.0

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

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

A large performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with H2 database server (2.5) to the normalized speed of OpenJPA with HSQLDB embedded database (12.0) reveals that in that case, OpenJPA with HSQLDB embedded is 4.8 times faster than DataNucleus with H2 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 H2 database server (2.4) reveals that in that case, OpenJPA with HSQLDB embedded is 245 times slower than DataNucleus with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test21.33.415.71.318.52.3
Element Collection Test0.0111.52.90.681.51.1
Inheritance Test0.00702.73.51.31.82.0
Indexing Test28.85.715.21.922.03.8
Graph (Binary Tree) Test2.91.53.61.23.21.3
Multithreading Test26.0failed19.65.122.85.1
All Tests13.23.010.11.911.62.4

DataNucleus with H2 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 H2 server in deleting JPA entity objects from the database. Comparing the normalized speed of DataNucleus with H2 database server (2.4) to the normalized speed of OpenJPA with HSQLDB embedded database (11.6) reveals that in these tests, OpenJPA with HSQLDB embedded is 4.8 times faster than DataNucleus with H2 server.

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
OpenJPA
HSQLDB embedded
DataNucleus
H2 server
Basic Person Test14.33.211.82.313.02.7
Element Collection Test2.01.93.50.782.71.3
Inheritance Test2.92.62.92.62.92.6
Indexing Test18.53.221.63.520.03.3
Graph (Binary Tree) Test3.42.83.73.03.52.9
Multithreading Test19.04.510.96.014.95.3
All Tests10.22.99.22.89.72.9

The results above show that in general OpenJPA with HSQLDB embedded is much more efficient than DataNucleus with H2 server in performing JPA database operations. Comparing the normalized speed of DataNucleus with H2 database server (2.9) to the normalized speed of OpenJPA with HSQLDB embedded database (9.7) reveals that in these tests, OpenJPA with HSQLDB embedded is 3.3 times faster than DataNucleus with H2 server.

A large performance gap has been detected when using database indexes with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with H2 database server (3.5) to the normalized speed of OpenJPA with HSQLDB embedded database (21.6) reveals that in that case, OpenJPA with HSQLDB embedded is 6.2 times faster than DataNucleus with H2 server.

Other Head to Head DBMS/JPA Comparisons