Compare with

Comparison of Hibernate with H2 server 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 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test8.4 6.7 7.6 
Element Collection Test14.6 8.8 11.7 
Inheritance Test5.5 13.4 9.4 
Indexing Test13.7 14.1 13.9 
Graph (Binary Tree) Test6.9 5.0 6.0 
Multithreading Test8.9 0.0000 4.5 
All Tests9.7 8.0 8.8 

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test2.20.432.0 2.10.43
Element Collection Test0.53 0.45 0.49 
Inheritance Test1.4 6.0 3.7 
Indexing Test1.3 0.010 0.68 
Graph (Binary Tree) Test0.16 0.29 0.22 
Multithreading Test1.5 7.1 4.3 
All Tests1.20.432.6 1.90.43

The results above show that in general Hibernate with H2 server 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 database server (1.9) reveals that in these tests, Hibernate with H2 server is 4.4 times faster than DataNucleus with SQLite embedded.

A large 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 database server (2.2) reveals that in that case, Hibernate with H2 server is 5.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 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test0.55failed1.9 1.2failed
Element Collection Test0.94 0.52 0.73 
Inheritance Test0.59 2.1 1.3 
Indexing Test0.68 2.0 1.4 
Multithreading Test2.2 2.8 2.5 
All Tests0.99failed1.9 1.4failed

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 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test1.80.0251.7 1.80.025
Element Collection Test3.8 0.88 2.3 
Inheritance Test3.5 1.9 2.7 
Indexing Test6.0 2.0 4.0 
Graph (Binary Tree) Test0.67 0.30 0.49 
Multithreading Test2.5 1.0 1.7 
All Tests3.00.0251.3 2.20.025

The results above show that in general Hibernate with H2 server 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 database server (2.2) reveals that in these tests, Hibernate with H2 server is 88.0 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 database server (1.8) reveals that in that case, Hibernate with H2 server is 72.0 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 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test14.80.1714.0 14.40.17
Element Collection Test6.0 0.93 3.5 
Inheritance Test7.6 7.1 7.3 
Indexing Test16.2 5.9 11.1 
Graph (Binary Tree) Test6.2 8.2 7.2 
Multithreading Test5.2 0.0000 2.6 
All Tests9.30.176.0 7.70.17

The results above show that in general Hibernate with H2 server 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 database server (7.7) reveals that in these tests, Hibernate with H2 server is 45.3 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 database server (14.8) reveals that in that case, Hibernate with H2 server is 87.1 times faster than DataNucleus with SQLite embedded.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Hibernate
H2 server
DataNucleus
SQLite embedded
Basic Person Test5.50.215.3 5.40.21
Element Collection Test5.2 2.3 3.7 
Inheritance Test3.7 6.1 4.9 
Indexing Test7.6 4.8 6.2 
Graph (Binary Tree) Test3.5 3.5 3.5 
Multithreading Test4.1 2.2 3.1 
All Tests5.00.214.0 4.50.21

The results above show that in general Hibernate with H2 server 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 database server (4.5) reveals that in these tests, Hibernate with H2 server is 21.4 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 database server (5.5) reveals that in that case, Hibernate with H2 server is 26.2 times faster than DataNucleus with SQLite embedded.

Other Head to Head DBMS/JPA Comparisons