Compare with

Comparison of DataNucleus with MySQL server vs OpenJPA with H2 server

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 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test2.63.71.42.22.02.9
Element Collection Test1.02.60.481.50.762.1
Inheritance Test2.54.51.32.01.93.2
Indexing Test4.07.32.53.63.35.4
Graph (Binary Tree) Test1.11.10.990.841.10.97
Multithreading Test6.27.72.54.24.45.9
All Tests2.94.51.52.42.23.4

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

A large performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of DataNucleus with MySQL database server (0.48) to the normalized speed of OpenJPA with H2 database server (1.5) reveals that in that case, OpenJPA with H2 server is 3.1 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 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test0.962.99.37.65.15.2
Element Collection Test0.180.00220.771.90.470.93
Inheritance Test0.550.0138.54.04.52.0
Indexing Test0.824.19.78.85.36.5
Graph (Binary Tree) Test2.10.383.50.492.80.44
Multithreading Test0.275.97.814.04.010.0
All Tests0.812.26.66.13.74.2

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

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 database server (5.9) reveals that in that case, OpenJPA with H2 server is 21.9 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.0022) to the normalized speed of DataNucleus with MySQL database server (0.18) reveals that in that case, OpenJPA with H2 server is 81.8 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 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test7.23.72.21.04.72.4
Element Collection Test5.82.00.271.23.11.6
Inheritance Test2.92.81.71.12.32.0
Indexing Test0.00843.82.57.51.25.7
Multithreading Testfailed0.98failed1.0failed1.0
All Tests4.02.71.72.42.82.5

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

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

A large performance gap has been detected when using JPA element collections with small retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (2.0) to the normalized speed of DataNucleus with MySQL database server (5.8) reveals that in that case, DataNucleus with MySQL server is 2.9 times faster than OpenJPA with H2 server.

On the other hand, DataNucleus with MySQL server is slower, for instance, 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 database server (3.8) reveals that in that case, DataNucleus with MySQL server is 452 times slower than OpenJPA with H2 server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test0.613.01.12.00.882.5
Element Collection Test0.310.00780.441.90.380.94
Inheritance Test0.510.0341.82.81.11.4
Indexing Test0.682.82.23.21.53.0
Graph (Binary Tree) Test0.910.790.470.430.690.61
Multithreading Test0.647.0failed2.50.644.8
All Tests0.612.31.22.10.882.2

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

The results above show that in general OpenJPA with H2 server is 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 database server (2.2) reveals that in these tests, OpenJPA with H2 server is 2.5 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 database server (7.0) reveals that in that case, OpenJPA with H2 server is 10.9 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0078) to the normalized speed of DataNucleus with MySQL database server (0.31) reveals that in that case, OpenJPA with H2 server is 39.7 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 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test0.703.21.32.21.02.7
Element Collection Test0.170.00600.400.880.290.44
Inheritance Test0.410.0301.33.10.871.6
Indexing Test1.76.51.93.61.85.1
Graph (Binary Tree) Test0.490.730.460.750.470.74
Multithreading Testfailed7.6failed5.2failed6.4
All Tests0.693.01.12.60.892.8

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

The results above show that in general OpenJPA with H2 server 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 database server (2.8) reveals that in these tests, OpenJPA with H2 server is 3.1 times faster than DataNucleus with MySQL server.

A large 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 database server (3.2) reveals that in that case, OpenJPA with H2 server is 4.6 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using JPA element collections with small transaction size. Comparing the normalized speed of OpenJPA with H2 database server (0.0060) to the normalized speed of DataNucleus with MySQL database server (0.17) reveals that in that case, OpenJPA with H2 server is 28.3 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 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
Basic Person Test2.43.33.13.02.73.1
Element Collection Test1.50.930.471.50.991.2
Inheritance Test1.41.52.92.62.12.0
Indexing Test1.44.93.85.42.65.1
Graph (Binary Tree) Test1.20.751.40.631.30.69
Multithreading Test2.45.95.15.43.55.6
All Tests1.72.92.63.22.13.0

The results above show that in general OpenJPA with H2 server is more efficient than DataNucleus with MySQL server in performing JPA database operations.

A large 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 database server (4.9) reveals that in that case, OpenJPA with H2 server is 3.5 times faster than DataNucleus with MySQL server.

On the other hand, OpenJPA with H2 server is slower, for instance, when using graphs of objects with large transaction/retrieval size. Comparing the normalized speed of OpenJPA with H2 database server (0.63) to the normalized speed of DataNucleus with MySQL database server (1.4) reveals that in that case, OpenJPA with H2 server is 2.2 times slower than DataNucleus with MySQL server.

Other Head to Head DBMS/JPA Comparisons