Compare with

Comparison of Hibernate with H2 server vs DataNucleus with DB4O 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
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test4.60.0593.01.33.80.69
Element Collection Test3.70.0451.11.02.40.52
Inheritance Test6.70.0513.10.854.90.45
Indexing Test8.20.0804.22.36.21.2
Graph (Binary Tree) Test3.4failed3.9failed3.7failed
Multithreading Test6.8failed5.0failed5.9failed
All Tests5.60.0593.41.44.50.71

DataNucleus with DB4O embedded has failed in 4 tests (see exceptions).

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of DataNucleus with DB4O embedded database (0.051) to the normalized speed of Hibernate with H2 database server (6.7) reveals that in that case, Hibernate with H2 server is 131 times faster than DataNucleus with DB4O embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test3.10.00476.01.84.60.90
Element Collection Test1.00.00381.11.51.00.77
Inheritance Test2.90.00357.62.25.21.1
Indexing Test2.60.00437.01.84.80.89
Graph (Binary Tree) Test0.42failed1.1failed0.78failed
Multithreading Test6.5failed10.5failed8.5failed
All Tests2.80.00415.61.84.20.91

DataNucleus with DB4O embedded has failed in 4 tests (see exceptions).

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

A huge performance gap has been detected when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of DataNucleus with DB4O embedded database (0.0035) to the normalized speed of Hibernate with H2 database server (2.9) reveals that in that case, Hibernate with H2 server is 829 times faster than DataNucleus with DB4O embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test3.7failed1.0failed2.3failed
Element Collection Test3.7failed0.63failed2.2failed
Inheritance Test3.2failed1.4failed2.3failed
Indexing Test1.7failed5.8failed3.8failed
Multithreading Test1.1failed0.88failed1.0failed
All Tests2.7failed1.9failed2.3failed

DataNucleus with DB4O embedded has failed in 10 tests (see exceptions).

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test2.90.0121.80.762.40.39
Element Collection Test2.60.0121.11.11.90.53
Inheritance Test3.20.0112.50.812.90.41
Indexing Test2.90.0112.71.32.80.64
Graph (Binary Tree) Test1.2failed0.43failed0.79failed
Multithreading Test5.6failed2.4failed4.0failed
All Tests3.10.0121.80.972.50.49

DataNucleus with DB4O embedded has failed in 4 tests (see exceptions).

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction size. Comparing the normalized speed of DataNucleus with DB4O embedded database (0.011) to the normalized speed of Hibernate with H2 database server (3.2) reveals that in that case, Hibernate with H2 server is 291 times faster than DataNucleus with DB4O embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test3.80.0112.41.53.10.74
Element Collection Test1.90.0101.11.61.50.80
Inheritance Test3.70.00932.51.13.10.57
Indexing Test7.60.0173.12.15.31.1
Graph (Binary Tree) Test0.99failed0.91failed0.95failed
Multithreading Test6.1failed7.3failed6.7failed
All Tests4.00.0122.91.63.50.79

DataNucleus with DB4O embedded has failed in 4 tests (see exceptions).

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

A huge performance gap has been detected when using database indexes with small transaction size. Comparing the normalized speed of DataNucleus with DB4O embedded database (0.017) to the normalized speed of Hibernate with H2 database server (7.6) reveals that in that case, Hibernate with H2 server is 447 times faster than DataNucleus with DB4O embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Hibernate
H2 server
DataNucleus
DB4O embedded
Basic Person Test3.60.0222.81.33.20.68
Element Collection Test2.60.0181.01.31.80.66
Inheritance Test4.00.0193.41.23.70.63
Indexing Test4.60.0284.51.94.60.94
Graph (Binary Tree) Test1.5failed1.6failed1.6failed
Multithreading Test5.2failed5.2failed5.2failed
All Tests3.70.0223.21.43.40.73

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

A huge performance gap has been detected when using class inheritance in the object model with small transaction/retrieval size. Comparing the normalized speed of DataNucleus with DB4O embedded database (0.019) to the normalized speed of Hibernate with H2 database server (4.0) reveals that in that case, Hibernate with H2 server is 211 times faster than DataNucleus with DB4O embedded.

Other Head to Head DBMS/JPA Comparisons