Compare with

Comparison of Hibernate with HSQLDB server vs DataNucleus with H2 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
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped15.2stopped8.0stopped11.6
Element Collection Teststopped9.8stopped5.2stopped7.5
Inheritance Teststopped6.2stopped12.0stopped9.1
Indexing Teststopped16.0stopped14.5stopped15.3
Graph (Binary Tree) Teststopped5.2stopped4.6stopped4.9
Multithreading Teststopped8.0stopped0.0000stopped4.0
All Testsstopped10.1stopped7.4stopped8.7

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped3.9stopped8.3stopped6.1
Element Collection Teststopped2.9stopped5.8stopped4.4
Inheritance Teststopped4.1stopped12.4stopped8.2
Indexing Teststopped3.7stopped8.5stopped6.1
Graph (Binary Tree) Teststopped3.6stopped6.7stopped5.2
Multithreading Teststopped5.6stopped10.1stopped7.9
All Testsstopped4.0stopped8.6stopped6.3

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped0.63stopped3.6stopped2.1
Element Collection Teststopped1.7stopped3.2stopped2.4
Inheritance Teststopped0.53stopped3.8stopped2.2
Indexing Teststopped0.63stopped2.0stopped1.3
Multithreading Teststoppedfailedstoppedfailedstoppedfailed
All Testsstopped0.88stopped3.2stopped2.0

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

The results above show that in general DataNucleus with H2 embedded is much more efficient than Hibernate with HSQLDB server in executing the tested JPA queries. Comparing the normalized speed of Hibernate with HSQLDB database server (0.0000) to the normalized speed of DataNucleus with H2 embedded database (2.0) reveals that in these tests, DataNucleus with H2 embedded is ? times faster than Hibernate with HSQLDB server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped7.0stopped5.9stopped6.4
Element Collection Teststopped21.8stopped6.2stopped14.0
Inheritance Teststopped12.2stopped6.2stopped9.2
Indexing Teststopped32.7stopped6.9stopped19.8
Graph (Binary Tree) Teststopped7.0stopped3.2stopped5.1
Multithreading Teststoppedfailedstoppedfailedstoppedfailed
All Testsstopped16.1stopped5.7stopped10.9

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped1.8stopped0.81stopped1.3
Element Collection Teststopped2.7stopped0.25stopped1.5
Inheritance Teststopped2.1stopped0.59stopped1.3
Indexing Teststopped3.4stopped0.57stopped2.0
Graph (Binary Tree) Teststopped13.5stopped26.4stopped20.0
Multithreading Teststoppedfailedstopped78.6stopped78.6
All Testsstopped4.7stopped17.9stopped11.9

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Hibernate
HSQLDB server
DataNucleus
H2 embedded
Basic Person Teststopped5.7stopped5.3stopped5.5
Element Collection Teststopped7.8stopped4.1stopped5.9
Inheritance Teststopped5.0stopped7.0stopped6.0
Indexing Teststopped11.3stopped6.5stopped8.9
Graph (Binary Tree) Teststopped7.4stopped10.2stopped8.8
Multithreading Teststopped6.8stopped29.6stopped20.5
All Testsstopped7.4stopped9.1stopped8.2

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

A huge performance gap has been detected when using simple basic entities with small transaction/retrieval size. Comparing the normalized speed of Hibernate with HSQLDB database server (0.0000) to the normalized speed of DataNucleus with H2 embedded database (5.7) reveals that in that case, DataNucleus with H2 embedded is ? times faster than Hibernate with HSQLDB server.

Other Head to Head DBMS/JPA Comparisons