Compare with

Comparison of Hibernate with H2 embedded vs DataNucleus with SQLite 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 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test8.9 9.3 9.1 
Element Collection Test11.5 7.6 9.5 
Inheritance Test6.8 9.4 8.1 
Indexing Test12.5 12.3 12.4 
Graph (Binary Tree) Test7.7 8.5 8.1 
Multithreading Test9.8 0.0000 4.9 
All Tests9.5 7.8 8.7 

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test5.20.4312.7 8.90.43
Element Collection Test3.8 3.9 3.9 
Inheritance Test9.4 18.4 13.9 
Indexing Test9.1 13.2 11.1 
Graph (Binary Tree) Test1.5 3.4 2.5 
Multithreading Test10.7 16.4 13.6 
All Tests6.60.4311.3 9.00.43

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

A huge performance gap has been detected when using simple basic entities with small retrieval size. Comparing the normalized speed of DataNucleus with SQLite embedded database (0.43) to the normalized speed of Hibernate with H2 embedded database (5.2) reveals that in that case, Hibernate with H2 embedded is 12.1 times faster than DataNucleus with SQLite embedded.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test3.0failed5.5 4.2failed
Element Collection Test4.4 3.3 3.9 
Inheritance Test1.7 5.6 3.7 
Indexing Test4.7 6.4 5.5 
Multithreading Test2.0 5.9 4.0 
All Tests3.2failed5.4 4.3failed

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test10.60.02510.1 10.40.025
Element Collection Test16.7 5.9 11.3 
Inheritance Test10.9 14.6 12.8 
Indexing Test24.0 12.3 18.2 
Graph (Binary Tree) Test5.8 4.0 4.9 
Multithreading Test7.0 5.1 6.1 
All Tests12.50.0258.7 10.60.025

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

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with SQLite embedded database (0.025) to the normalized speed of Hibernate with H2 embedded database (10.6) reveals that in that case, Hibernate with H2 embedded is 424 times faster than DataNucleus with SQLite embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test31.20.1723.7 27.50.17
Element Collection Test22.7 3.1 12.9 
Inheritance Test41.4 18.0 29.7 
Indexing Test66.1 14.2 40.1 
Graph (Binary Tree) Test16.7 22.4 19.6 
Multithreading Test20.4 0.0000 10.2 
All Tests33.10.1713.6 23.30.17

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

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with SQLite embedded database (0.17) to the normalized speed of Hibernate with H2 embedded database (31.2) reveals that in that case, Hibernate with H2 embedded is 184 times faster than DataNucleus with SQLite embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test10.2 10.2 10.2 
Element Collection Test12.4 12.4 12.4 
Inheritance Test11.2 11.7 11.4 
Indexing Test11.0 11.0 11.0 
Graph (Binary Tree) Test4.0 4.0 4.0 
Multithreading Test10.2 10.2 10.2 
All Tests9.8 9.9 9.9 

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Basic Person Test11.80.2112.3 12.00.21
Element Collection Test11.8 4.8 8.3 
Inheritance Test14.1 13.2 13.6 
Indexing Test23.3 11.7 17.5 
Graph (Binary Tree) Test7.9 9.6 8.8 
Multithreading Test10.0 5.5 7.8 
All Tests13.30.219.5 11.40.21

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

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

Other Head to Head DBMS/JPA Comparisons