Compare with

Comparison of DataNucleus with SQLite embedded vs Hibernate 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
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test 8.9 9.3 9.1
Element Collection Test 11.5 7.6 9.5
Inheritance Test 6.8 9.4 8.1
Indexing Test 12.5 12.3 12.4
Graph (Binary Tree) Test 7.7 8.5 8.1
Multithreading Test 9.8 0.0000 4.9
All Tests 9.5 7.8 8.7

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.435.2 12.70.438.9
Element Collection Test 3.8 3.9 3.9
Inheritance Test 9.4 18.4 13.9
Indexing Test 9.1 13.2 11.1
Graph (Binary Tree) Test 1.5 3.4 2.5
Multithreading Test 10.7 16.4 13.6
All Tests0.436.6 11.30.439.0

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
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Testfailed3.0 5.5failed4.2
Element Collection Test 4.4 3.3 3.9
Inheritance Test 1.7 5.6 3.7
Indexing Test 4.7 6.4 5.5
Multithreading Test 2.0 5.9 4.0
All Testsfailed3.2 5.4failed4.3

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
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.02510.6 10.10.02510.4
Element Collection Test 16.7 5.9 11.3
Inheritance Test 10.9 14.6 12.8
Indexing Test 24.0 12.3 18.2
Graph (Binary Tree) Test 5.8 4.0 4.9
Multithreading Test 7.0 5.1 6.1
All Tests0.02512.5 8.70.02510.6

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
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.1731.2 23.70.1727.5
Element Collection Test 22.7 3.1 12.9
Inheritance Test 41.4 18.0 29.7
Indexing Test 66.1 14.2 40.1
Graph (Binary Tree) Test 16.7 22.4 19.6
Multithreading Test 20.4 0.0000 10.2
All Tests0.1733.1 13.60.1723.3

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
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test 10.2 10.2 10.2
Element Collection Test 12.4 12.4 12.4
Inheritance Test 11.2 11.7 11.4
Indexing Test 11.0 11.0 11.0
Graph (Binary Tree) Test 4.0 4.0 4.0
Multithreading Test 10.2 10.2 10.2
All Tests 9.8 9.9 9.9

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
DataNucleus
SQLite embedded
Hibernate
H2 embedded
Basic Person Test0.2111.8 12.30.2112.0
Element Collection Test 11.8 4.8 8.3
Inheritance Test 14.1 13.2 13.6
Indexing Test 23.3 11.7 17.5
Graph (Binary Tree) Test 7.9 9.6 8.8
Multithreading Test 10.0 5.5 7.8
All Tests0.2113.3 9.50.2111.4

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