Compare with

Comparison of EclipseLink with MySQL server vs EclipseLink 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
 EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test3.625.11.58.92.617.0
Element Collection Test1.520.40.698.01.114.2
Inheritance Test3.528.71.48.72.418.7
Indexing Test5.337.62.514.03.925.8
Graph (Binary Tree) Test1.717.71.314.71.516.2
Multithreading Test7.230.32.411.44.820.8
All Tests3.826.61.610.92.718.8

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
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test0.4330.415.529.18.029.7
Element Collection Test0.1619.61.427.60.7823.6
Inheritance Test0.3933.817.639.89.036.8
Indexing Test0.4322.216.641.38.531.8
Graph (Binary Tree) Test0.5316.00.7620.00.6518.0
Multithreading Test0.1933.711.029.05.631.4
All Tests0.3525.910.531.15.428.5

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
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test1.54.40.441.40.952.9
Element Collection Test1.44.10.432.40.923.2
Inheritance Test1.13.40.612.00.862.7
Indexing Test0.2613.00.5222.80.3917.9
Multithreading Test1.91.00.720.671.30.85
All Tests1.25.20.545.90.885.5

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
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test0.3916.61.87.61.112.1
Element Collection Test0.2315.31.410.50.8312.9
Inheritance Test0.4215.72.69.81.512.7
Indexing Test0.4612.13.19.91.811.0
Graph (Binary Tree) Test0.6713.70.417.00.5410.3
Multithreading Test0.4820.92.64.21.512.6
All Tests0.4415.72.08.21.212.0

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
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test0.3535.11.719.61.027.4
Element Collection Test0.1119.30.518.50.3113.9
Inheritance Test0.2936.01.614.00.9425.0
Indexing Test0.4642.51.919.21.230.9
Graph (Binary Tree) Test0.5412.20.4914.40.5113.3
Multithreading Test0.3154.43.625.81.940.1
All Tests0.3433.31.616.90.9825.1

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
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
EclipseLink
MySQL server
EclipseLink
H2 embedded
Basic Person Test1.322.34.213.32.717.8
Element Collection Test0.6915.70.8911.40.7913.6
Inheritance Test1.123.54.814.92.919.2
Indexing Test1.425.54.921.53.223.5
Graph (Binary Tree) Test0.8514.90.7314.00.7914.5
Multithreading Test2.028.14.014.23.021.1
All Tests1.221.93.314.92.318.4

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