Compare with

Comparison of EclipseLink with H2 embedded vs EclipseLink 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
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test25.13.68.91.517.02.6
Element Collection Test20.41.58.00.6914.21.1
Inheritance Test28.73.58.71.418.72.4
Indexing Test37.65.314.02.525.83.9
Graph (Binary Tree) Test17.71.714.71.316.21.5
Multithreading Test30.37.211.42.420.84.8
All Tests26.63.810.91.618.82.7

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test30.40.4329.115.529.78.0
Element Collection Test19.60.1627.61.423.60.78
Inheritance Test33.80.3939.817.636.89.0
Indexing Test22.20.4341.316.631.88.5
Graph (Binary Tree) Test16.00.5320.00.7618.00.65
Multithreading Test33.70.1929.011.031.45.6
All Tests25.90.3531.110.528.55.4

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test4.41.51.40.442.90.95
Element Collection Test4.11.42.40.433.20.92
Inheritance Test3.41.12.00.612.70.86
Indexing Test13.00.2622.80.5217.90.39
Multithreading Test1.01.90.670.720.851.3
All Tests5.21.25.90.545.50.88

The results above show that in general EclipseLink with H2 embedded is much more efficient than EclipseLink with MySQL server in executing the tested JPA queries. Comparing the normalized speed of EclipseLink with MySQL database server (0.88) to the normalized speed of EclipseLink with H2 embedded database (5.5) reveals that in these tests, EclipseLink with H2 embedded is 6.2 times faster than EclipseLink with MySQL server.

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test16.60.397.61.812.11.1
Element Collection Test15.30.2310.51.412.90.83
Inheritance Test15.70.429.82.612.71.5
Indexing Test12.10.469.93.111.01.8
Graph (Binary Tree) Test13.70.677.00.4110.30.54
Multithreading Test20.90.484.22.612.61.5
All Tests15.70.448.22.012.01.2

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

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

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test35.10.3519.61.727.41.0
Element Collection Test19.30.118.50.5113.90.31
Inheritance Test36.00.2914.01.625.00.94
Indexing Test42.50.4619.21.930.91.2
Graph (Binary Tree) Test12.20.5414.40.4913.30.51
Multithreading Test54.40.3125.83.640.11.9
All Tests33.30.3416.91.625.10.98

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

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

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
Basic Person Test22.31.313.34.217.82.7
Element Collection Test15.70.6911.40.8913.60.79
Inheritance Test23.51.114.94.819.22.9
Indexing Test25.51.421.54.923.53.2
Graph (Binary Tree) Test14.90.8514.00.7314.50.79
Multithreading Test28.12.014.24.021.13.0
All Tests21.91.214.93.318.42.3

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

A huge performance gap has been detected when using JPA element collections with small transaction/retrieval size. Comparing the normalized speed of EclipseLink with MySQL database server (0.69) to the normalized speed of EclipseLink with H2 embedded database (15.7) reveals that in that case, EclipseLink with H2 embedded is 22.8 times faster than EclipseLink with MySQL server.

Other Head to Head DBMS/JPA Comparisons