Compare with

Comparison of OpenJPA with MySQL 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
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test3.919.21.68.02.713.6
Element Collection Test1.66.60.682.81.14.7
Inheritance Test3.615.61.44.42.510.0
Indexing Test5.624.42.411.84.018.1
Graph (Binary Tree) Test0.689.20.576.20.637.7
Multithreading Test7.234.92.77.14.921.0
All Tests3.718.31.56.72.612.5

The results above show that in general DataNucleus with H2 embedded is much more efficient than OpenJPA with MySQL server in persisting JPA entity objects to the database. Comparing the normalized speed of OpenJPA with MySQL database server (2.6) to the normalized speed of DataNucleus with H2 embedded database (12.5) reveals that in these tests, DataNucleus with H2 embedded is 4.8 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using graphs of objects with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.68) to the normalized speed of DataNucleus with H2 embedded database (9.2) reveals that in that case, DataNucleus with H2 embedded is 13.5 times faster than OpenJPA with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test3.213.222.713.512.913.3
Element Collection Test0.00386.42.98.91.47.7
Inheritance Test0.01712.26.912.73.412.4
Indexing Test2.48.123.416.512.912.3
Graph (Binary Tree) Test0.2710.60.3520.90.3115.8
Multithreading Test0.1413.318.19.99.111.6
All Tests1.010.612.413.76.712.2

The results above show that in general DataNucleus with H2 embedded is more efficient than OpenJPA with MySQL server in retrieving JPA entity objects from the database.

A huge performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0038) to the normalized speed of DataNucleus with H2 embedded database (6.4) reveals that in that case, DataNucleus with H2 embedded is 1,684 times faster than OpenJPA with MySQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test9.34.72.21.45.83.1
Element Collection Test4.85.01.12.42.93.7
Inheritance Test1.53.80.901.61.22.7
Indexing Test0.310.00412.11.81.20.91
Multithreading Test1.91.20.990.791.41.0
All Tests3.63.01.51.62.52.3

The results above show that in general OpenJPA with MySQL server is slightly more efficient than DataNucleus with H2 embedded in executing the tested JPA queries.

A huge performance gap has been detected when using database indexes with small retrieval size. Comparing the normalized speed of DataNucleus with H2 embedded database (0.0041) to the normalized speed of OpenJPA with MySQL database server (0.31) reveals that in that case, OpenJPA with MySQL server is 75.6 times faster than DataNucleus with H2 embedded.

On the other hand, OpenJPA with MySQL server is slower, for instance, when using class inheritance in the object model with small retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (1.5) to the normalized speed of DataNucleus with H2 embedded database (3.8) reveals that in that case, OpenJPA with MySQL server is 2.5 times slower than DataNucleus with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test0.7410.01.63.91.26.9
Element Collection Test0.0147.61.73.90.875.8
Inheritance Test0.0489.42.04.41.06.9
Indexing Test0.7410.63.05.91.98.2
Graph (Binary Tree) Test0.455.90.253.70.354.8
Multithreading Test0.55failed2.9failed1.7failed
All Tests0.428.71.94.41.26.5

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 OpenJPA with MySQL server in updating JPA entity objects in the database. Comparing the normalized speed of OpenJPA with MySQL database server (1.2) to the normalized speed of DataNucleus with H2 embedded database (6.5) reveals that in these tests, DataNucleus with H2 embedded is 5.4 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.014) to the normalized speed of DataNucleus with H2 embedded database (7.6) reveals that in that case, DataNucleus with H2 embedded is 543 times faster than OpenJPA with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test0.984.21.71.31.42.8
Element Collection Test0.00994.90.651.60.333.2
Inheritance Test0.0334.01.51.30.752.7
Indexing Test0.647.52.01.91.34.7
Graph (Binary Tree) Test0.415.60.434.10.424.8
Multithreading Test0.27failed2.9failed1.6failed
All Tests0.395.21.52.00.963.6

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 OpenJPA with MySQL server in deleting JPA entity objects from the database. Comparing the normalized speed of OpenJPA with MySQL database server (0.96) to the normalized speed of DataNucleus with H2 embedded database (3.6) reveals that in these tests, DataNucleus with H2 embedded is 3.8 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with MySQL database server (0.0099) to the normalized speed of DataNucleus with H2 embedded database (4.9) reveals that in that case, DataNucleus with H2 embedded is 495 times faster than OpenJPA with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
OpenJPA
MySQL server
DataNucleus
H2 embedded
Basic Person Test3.610.36.05.64.87.9
Element Collection Test1.36.11.43.91.35.0
Inheritance Test1.09.02.54.91.86.9
Indexing Test1.910.16.67.64.38.9
Graph (Binary Tree) Test0.457.80.408.70.438.3
Multithreading Test2.016.55.55.93.811.2
All Tests1.89.63.96.02.87.8

The results above show that in general DataNucleus with H2 embedded is more efficient than OpenJPA with MySQL server in performing JPA database operations. Comparing the normalized speed of OpenJPA with MySQL database server (2.8) to the normalized speed of DataNucleus with H2 embedded database (7.8) reveals that in these tests, DataNucleus with H2 embedded is 2.8 times faster than OpenJPA with MySQL server.

A huge performance gap has been detected when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with MySQL database server (0.40) to the normalized speed of DataNucleus with H2 embedded database (8.7) reveals that in that case, DataNucleus with H2 embedded is 21.7 times faster than OpenJPA with MySQL server.

Other Head to Head DBMS/JPA Comparisons