Compare with

Comparison of OpenJPA with H2 server vs DataNucleus with MySQL 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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test3.72.62.21.42.92.0
Element Collection Test2.61.01.50.482.10.76
Inheritance Test4.52.52.01.33.21.9
Indexing Test7.34.03.62.55.43.3
Graph (Binary Tree) Test1.11.10.840.990.971.1
Multithreading Test7.76.24.22.55.94.4
All Tests4.52.92.41.53.42.2

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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test2.90.967.69.35.25.1
Element Collection Test0.00220.181.90.770.930.47
Inheritance Test0.0130.554.08.52.04.5
Indexing Test4.10.828.89.76.55.3
Graph (Binary Tree) Test0.382.10.493.50.442.8
Multithreading Test5.90.2714.07.810.04.0
All Tests2.20.816.16.64.23.7

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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test3.77.21.02.22.44.7
Element Collection Test2.05.81.20.271.63.1
Inheritance Test2.82.91.11.72.02.3
Indexing Test3.80.00847.52.55.71.2
Multithreading Test0.98failed1.0failed1.0failed
All Tests2.74.02.41.72.52.8

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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test3.00.612.01.12.50.88
Element Collection Test0.00780.311.90.440.940.38
Inheritance Test0.0340.512.81.81.41.1
Indexing Test2.80.683.22.23.01.5
Graph (Binary Tree) Test0.790.910.430.470.610.69
Multithreading Test7.00.642.5failed4.80.64
All Tests2.30.612.11.22.20.88

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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test3.20.702.21.32.71.0
Element Collection Test0.00600.170.880.400.440.29
Inheritance Test0.0300.413.11.31.60.87
Indexing Test6.51.73.61.95.11.8
Graph (Binary Tree) Test0.730.490.750.460.740.47
Multithreading Test7.6failed5.2failed6.4failed
All Tests3.00.692.61.12.80.89

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
 OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
OpenJPA
H2 server
DataNucleus
MySQL server
Basic Person Test3.32.43.03.13.12.7
Element Collection Test0.931.51.50.471.20.99
Inheritance Test1.51.42.62.92.02.1
Indexing Test4.91.45.43.85.12.6
Graph (Binary Tree) Test0.751.20.631.40.691.3
Multithreading Test5.92.45.45.15.63.5
All Tests2.91.73.22.63.02.1

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