Compare with

Comparison of DataNucleus with MySQL server vs OpenJPA 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
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test2.617.11.45.82.011.5
Element Collection Test1.010.90.484.90.767.9
Inheritance Test2.514.31.35.91.910.1
Indexing Test4.024.42.513.73.319.1
Graph (Binary Tree) Test1.16.80.996.71.16.7
Multithreading Test6.234.22.510.24.422.2
All Tests2.917.91.57.92.212.9

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.9614.69.327.25.120.9
Element Collection Test0.180.00460.774.30.472.1
Inheritance Test0.550.0118.57.44.53.7
Indexing Test0.8217.09.735.05.326.0
Graph (Binary Tree) Test2.11.03.51.42.81.2
Multithreading Test0.2718.77.827.64.023.1
All Tests0.818.66.617.13.712.8

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

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test7.25.02.21.14.73.1
Element Collection Test5.81.70.271.33.11.5
Inheritance Test2.92.21.71.22.31.7
Indexing Test0.008413.82.523.21.218.5
Multithreading Testfailed1.4failed0.60failed0.99
All Tests4.04.81.75.52.85.1

DataNucleus with MySQL server has failed in 2 tests (see exceptions).

The results above show that in general OpenJPA with H2 embedded is more efficient than DataNucleus with MySQL server 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 MySQL database server (0.0084) to the normalized speed of OpenJPA with H2 embedded database (13.8) reveals that in that case, OpenJPA with H2 embedded is 1,643 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 embedded database (1.7) to the normalized speed of DataNucleus with MySQL database server (5.8) reveals that in that case, OpenJPA with H2 embedded is 3.4 times slower than DataNucleus with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.6110.01.16.00.888.0
Element Collection Test0.310.0110.443.80.381.9
Inheritance Test0.510.0461.85.01.12.5
Indexing Test0.688.92.27.01.58.0
Graph (Binary Tree) Test0.912.40.471.30.691.9
Multithreading Test0.6416.6failed4.30.6410.4
All Tests0.616.31.24.60.885.4

DataNucleus with MySQL server has failed in 1 tests (see exceptions).

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

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

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.011) to the normalized speed of DataNucleus with MySQL database server (0.31) reveals that in that case, OpenJPA with H2 embedded is 28.2 times slower than DataNucleus with MySQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test0.7018.31.311.11.014.7
Element Collection Test0.170.0120.402.90.291.4
Inheritance Test0.410.0301.36.60.873.3
Indexing Test1.723.21.99.71.816.4
Graph (Binary Tree) Test0.491.80.462.40.472.1
Multithreading Testfailed31.2failed17.3failed24.2
All Tests0.6912.41.18.30.8910.4

DataNucleus with MySQL server has failed in 2 tests (see exceptions).

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

A huge performance gap has been detected when using simple basic entities with small transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.70) to the normalized speed of OpenJPA with H2 embedded database (18.3) reveals that in that case, OpenJPA with H2 embedded is 26.1 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 embedded is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 embedded database (0.012) to the normalized speed of DataNucleus with MySQL database server (0.17) reveals that in that case, OpenJPA with H2 embedded is 14.2 times slower than DataNucleus with MySQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
DataNucleus
MySQL server
OpenJPA
H2 embedded
Basic Person Test2.413.03.110.22.711.6
Element Collection Test1.52.50.473.40.993.0
Inheritance Test1.43.32.95.22.14.3
Indexing Test1.417.53.817.72.617.6
Graph (Binary Tree) Test1.23.01.43.01.33.0
Multithreading Test2.420.45.112.03.516.2
All Tests1.710.22.68.82.19.5

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

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

Other Head to Head DBMS/JPA Comparisons