Compare with

Comparison of Hibernate with MySQL 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
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test3.614.21.64.82.69.5
Element Collection Test1.66.60.722.11.14.3
Inheritance Test3.713.61.64.62.79.1
Indexing Test5.424.62.611.14.017.8
Graph (Binary Tree) Test1.56.81.24.51.45.7
Multithreading Test7.438.52.98.55.223.5
All Tests3.917.41.85.92.811.7

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

A large performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (7.4) to the normalized speed of DataNucleus with HSQLDB embedded database (38.5) reveals that in that case, DataNucleus with HSQLDB embedded is 5.2 times faster than Hibernate with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test3.06.611.010.27.08.4
Element Collection Test0.343.61.28.10.795.8
Inheritance Test1.35.714.58.87.97.2
Indexing Test2.55.112.89.57.67.3
Graph (Binary Tree) Test0.557.20.719.30.638.3
Multithreading Test0.238.113.89.57.08.8
All Tests1.36.09.09.25.27.6

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test10.01.42.00.486.00.95
Element Collection Test6.71.30.530.673.61.0
Inheritance Test2.81.61.60.612.21.1
Indexing Test0.440.00162.00.631.20.32
Multithreading Test2.10.400.98failed1.50.40
All Tests4.40.961.40.602.90.80

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

The results above show that in general Hibernate with MySQL 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 MySQL database server (2.9) reveals that in these tests, Hibernate with MySQL server is 3.6 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 Hibernate with MySQL database server (0.44) reveals that in that case, Hibernate with MySQL server is 275 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
 Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test0.7311.51.62.71.27.1
Element Collection Test0.396.91.22.70.784.8
Inheritance Test0.6110.32.13.61.46.9
Indexing Test0.8111.42.64.41.77.9
Graph (Binary Tree) Test0.693.50.401.50.542.5
Multithreading Test0.63failed3.0failed1.8failed
All Tests0.648.71.83.01.25.8

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

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test1.14.21.71.31.42.8
Element Collection Test0.214.90.531.60.373.2
Inheritance Test0.654.01.81.31.22.7
Indexing Test0.817.52.01.91.44.7
Graph (Binary Tree) Test0.552.90.622.00.582.5
Multithreading Test0.3540.14.113.72.226.9
All Tests0.6110.61.83.71.27.1

The results above show that in general DataNucleus with HSQLDB embedded is much more efficient than Hibernate with MySQL server in deleting JPA entity objects from the database. Comparing the normalized speed of Hibernate with MySQL database server (1.2) to the normalized speed of DataNucleus with HSQLDB embedded database (7.1) reveals that in these tests, DataNucleus with HSQLDB embedded is 5.9 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using multithreading with small transaction size. Comparing the normalized speed of Hibernate with MySQL database server (0.35) to the normalized speed of DataNucleus with HSQLDB embedded database (40.1) reveals that in that case, DataNucleus with HSQLDB embedded is 115 times faster than Hibernate with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Hibernate
MySQL server
DataNucleus
HSQLDB embedded
Basic Person Test3.77.63.63.93.65.7
Element Collection Test1.84.70.843.01.33.8
Inheritance Test1.87.14.33.83.15.4
Indexing Test2.09.74.45.53.27.6
Graph (Binary Tree) Test0.835.10.734.30.784.7
Multithreading Test2.121.85.010.63.617.0
All Tests2.19.03.24.82.77.0

The results above show that in general DataNucleus with HSQLDB embedded is more efficient than Hibernate with MySQL server in performing JPA database operations. Comparing the normalized speed of Hibernate with MySQL database server (2.7) to the normalized speed of DataNucleus with HSQLDB embedded database (7.0) reveals that in these tests, DataNucleus with HSQLDB embedded is 2.6 times faster than Hibernate with MySQL server.

A huge performance gap has been detected when using multithreading with small transaction/retrieval size. Comparing the normalized speed of Hibernate with MySQL database server (2.1) to the normalized speed of DataNucleus with HSQLDB embedded database (21.8) reveals that in that case, DataNucleus with HSQLDB embedded is 10.4 times faster than Hibernate with MySQL server.

Other Head to Head DBMS/JPA Comparisons