Compare with

Comparison of OpenJPA with Derby embedded 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
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test4.814.22.94.83.99.5
Element Collection Test2.86.61.92.12.44.3
Inheritance Test4.113.62.44.63.39.1
Indexing Test6.124.64.111.15.117.8
Graph (Binary Tree) Test1.56.81.44.51.45.7
Multithreading Test8.738.53.38.56.023.5
All Tests4.717.42.75.93.711.7

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

A large performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (1.5) to the normalized speed of DataNucleus with HSQLDB embedded database (6.8) reveals that in that case, DataNucleus with HSQLDB embedded is 4.5 times faster than OpenJPA with Derby embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test14.86.622.610.218.78.4
Element Collection Test0.00313.62.38.11.25.8
Inheritance Test0.0155.77.08.83.57.2
Indexing Test11.75.126.59.519.17.3
Graph (Binary Tree) Test0.937.21.29.31.18.3
Multithreading Test25.28.128.69.526.98.8
All Tests8.86.014.79.211.77.6

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

A large performance gap has been detected when using multithreading with small retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (8.1) to the normalized speed of OpenJPA with Derby embedded database (25.2) reveals that in that case, OpenJPA with Derby embedded is 3.1 times faster than DataNucleus with HSQLDB embedded.

On the other hand, OpenJPA with Derby embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0031) to the normalized speed of DataNucleus with HSQLDB embedded database (3.6) reveals that in that case, OpenJPA with Derby embedded is 1,161 times slower than DataNucleus with HSQLDB embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test49.71.49.90.4829.80.95
Element Collection Test2.71.39.60.676.11.0
Inheritance Test2.31.61.30.611.81.1
Indexing Test7.00.001617.10.6312.10.32
Multithreading Test40.90.4011.7failed26.30.40
All Tests20.50.969.90.6015.20.80

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

The results above show that in general OpenJPA with Derby embedded 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 OpenJPA with Derby embedded database (15.2) reveals that in these tests, OpenJPA with Derby embedded is 19.0 times faster than DataNucleus with HSQLDB embedded.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test5.611.55.22.75.47.1
Element Collection Test0.00906.92.22.71.14.8
Inheritance Test0.04510.34.63.62.36.9
Indexing Test6.111.48.74.47.47.9
Graph (Binary Tree) Test1.63.50.911.51.32.5
Multithreading Test18.3failed4.5failed11.4failed
All Tests5.38.74.43.04.85.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 OpenJPA with Derby embedded in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with Derby embedded database (0.0090) to the normalized speed of DataNucleus with HSQLDB embedded database (6.9) reveals that in that case, DataNucleus with HSQLDB embedded is 767 times faster than OpenJPA with Derby embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test4.24.24.51.34.32.8
Element Collection Test0.00714.91.61.60.803.2
Inheritance Test0.0354.03.01.31.52.7
Indexing Test5.37.53.61.94.44.7
Graph (Binary Tree) Test0.802.90.932.00.862.5
Multithreading Test5.740.16.213.76.026.9
All Tests2.710.63.33.73.07.1

The results above show that in general DataNucleus with HSQLDB embedded is more efficient than OpenJPA with Derby embedded in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with Derby embedded database (3.0) to the normalized speed of DataNucleus with HSQLDB embedded database (7.1) reveals that in these tests, DataNucleus with HSQLDB embedded is 2.4 times faster than OpenJPA with Derby embedded.

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

On the other hand, DataNucleus with HSQLDB embedded is slower, for instance, when using simple basic entities with large transaction size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (1.3) to the normalized speed of OpenJPA with Derby embedded database (4.5) reveals that in that case, DataNucleus with HSQLDB embedded is 3.5 times slower than OpenJPA with Derby embedded.

Comparison of database storage efficiency (normalized score, higher is better)

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test52.841.452.841.452.841.4
Element Collection Test42.423.442.423.442.423.4
Inheritance Test44.241.444.241.444.241.4
Indexing Test53.148.454.049.253.548.8
Graph (Binary Tree) Test12.812.59.69.411.210.9
Multithreading Test50.751.99.710.330.231.1
All Tests42.736.535.529.239.132.9

The results above show that in general OpenJPA with Derby embedded is slightly more efficient than DataNucleus with HSQLDB embedded in using disk space.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
OpenJPA
Derby embedded
DataNucleus
HSQLDB embedded
Basic Person Test15.87.69.03.912.45.7
Element Collection Test1.14.73.53.02.33.8
Inheritance Test1.37.13.73.82.55.4
Indexing Test7.29.712.05.59.67.6
Graph (Binary Tree) Test1.25.11.14.31.24.7
Multithreading Test19.821.810.910.615.317.0
All Tests8.09.06.94.87.47.0

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

A large performance gap has been detected when using simple basic entities with large transaction/retrieval size. Comparing the normalized speed of DataNucleus with HSQLDB embedded database (3.9) to the normalized speed of OpenJPA with Derby embedded database (9.0) reveals that in that case, OpenJPA with Derby embedded is 2.3 times faster than DataNucleus with HSQLDB embedded.

On the other hand, OpenJPA with Derby 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 Derby embedded database (1.3) to the normalized speed of DataNucleus with HSQLDB embedded database (7.1) reveals that in that case, OpenJPA with Derby embedded is 5.5 times slower than DataNucleus with HSQLDB embedded.

Other Head to Head DBMS/JPA Comparisons