Compare with

Comparison of EclipseLink with H2 embedded vs EclipseLink with PostgreSQL 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
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test25.17.38.94.217.05.8
Element Collection Test20.43.18.01.914.22.5
Inheritance Test28.76.98.75.018.75.9
Indexing Test37.610.014.06.825.88.4
Graph (Binary Tree) Test17.73.514.73.316.23.4
Multithreading Test30.331.811.414.520.823.1
All Tests26.610.410.96.018.88.2

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

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

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test30.46.829.117.229.712.0
Element Collection Test19.60.02627.60.02023.60.023
Inheritance Test33.86.039.819.736.812.9
Indexing Test22.25.641.319.531.812.6
Graph (Binary Tree) Test16.00.4720.00.6118.00.54
Multithreading Test33.713.529.027.831.420.6
All Tests25.95.431.114.128.59.8

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

A huge performance gap has been detected when using JPA element collections with large retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.020) to the normalized speed of EclipseLink with H2 embedded database (27.6) reveals that in that case, EclipseLink with H2 embedded is 1,380 times faster than EclipseLink with PostgreSQL server.

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

Retrieval Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test4.455.51.47.82.931.6
Element Collection Test4.115.42.40.0283.27.7
Inheritance Test3.454.92.011.52.733.2
Indexing Test13.00.07722.810.017.95.1
Multithreading Test1.055.30.6712.00.8533.7
All Tests5.236.25.98.35.522.3

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

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

On the other hand, EclipseLink with PostgreSQL server is slower, for instance, when using database indexes with small retrieval size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.077) to the normalized speed of EclipseLink with H2 embedded database (13.0) reveals that in that case, EclipseLink with PostgreSQL server is 169 times slower than EclipseLink with H2 embedded.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test16.66.27.64.112.15.1
Element Collection Test15.30.08010.50.02812.90.054
Inheritance Test15.76.49.86.112.76.2
Indexing Test12.16.59.97.011.06.8
Graph (Binary Tree) Test13.70.907.00.5010.30.70
Multithreading Test20.936.04.29.112.622.5
All Tests15.79.38.24.512.06.9

The results above show that in general EclipseLink with H2 embedded is more efficient than EclipseLink with PostgreSQL server in updating JPA entity objects in the database.

A huge performance gap has been detected when using JPA element collections with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.028) to the normalized speed of EclipseLink with H2 embedded database (10.5) reveals that in that case, EclipseLink with H2 embedded is 375 times faster than EclipseLink with PostgreSQL server.

On the other hand, EclipseLink with H2 embedded is slower, for instance, when using multithreading with large transaction size. Comparing the normalized speed of EclipseLink with H2 embedded database (4.2) to the normalized speed of EclipseLink with PostgreSQL database server (9.1) reveals that in that case, EclipseLink with H2 embedded is 2.2 times slower than EclipseLink with PostgreSQL server.

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

Transaction Size =>Few EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test35.15.719.65.727.45.7
Element Collection Test19.30.0258.5stopped13.90.012
Inheritance Test36.05.514.05.425.05.4
Indexing Test42.510.419.210.030.910.2
Graph (Binary Tree) Test12.20.01614.40.01313.30.015
Multithreading Test54.426.325.816.840.121.6
All Tests33.38.016.96.325.17.2

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

A huge performance gap has been detected when using graphs of objects with large transaction size. Comparing the normalized speed of EclipseLink with PostgreSQL database server (0.013) to the normalized speed of EclipseLink with H2 embedded database (14.4) reveals that in that case, EclipseLink with H2 embedded is 1,108 times faster than EclipseLink with PostgreSQL server.

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

Transaction/Retrieval SizeFew EntitiesMany EntitiesAverage Score
 EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
EclipseLink
H2 embedded
EclipseLink
PostgreSQL server
Basic Person Test22.316.313.37.817.812.1
Element Collection Test15.73.711.40.4013.62.1
Inheritance Test23.515.914.99.519.212.7
Indexing Test25.56.521.510.723.58.6
Graph (Binary Tree) Test14.91.214.01.114.51.2
Multithreading Test28.132.614.216.021.124.3
All Tests21.913.114.97.818.410.5

The results above show that in general EclipseLink with H2 embedded is more efficient than EclipseLink with PostgreSQL server in performing JPA database operations.

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

Other Head to Head DBMS/JPA Comparisons