REST VS GRAPHQL: A PERFORMANCE COMPARISON UNDER VARYING LOAD AND QUERY COMPLEXITY
2026 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [en]
Modern software systems heavily rely on APIs to allow communication between clients and servers,making the choice of API architecture a vital factor for an application's performance and resourceefficiency. While REST has been a dominant choice for over two decades, GraphQL has gained rapidendorsement by offering a more flexible and client-driven approach, designed to eliminate the knownREST limitations, such as over-fetching. However, studies that isolate query complexity as a variablewhile measuring server-side resource usage are limited.
This study is meant to address that gap by deploying two standard REST and GraphQL APIs within anisolated environment to evaluate their latency, throughput, CPU usage, and memory usage acrossvarying query complexities and load conditions. Additionally, an optimized REST implementationutilizing fewer requests through a more specific database query was deployed to evaluate theperformance against the standard architectures during nested workloads.
The empirical results show that the performance gap is primarily determined by query complexity ratherthan user load. For flat queries, REST is consistently faster due to its minimal parsing overhead. Viceversa, for complex nested queries, GraphQL outperforms standard REST in performance and throughputby resolving the query in a single request. However, metrics of the containers reveal that GraphQLconsistently demands higher memory usage, peaking at almost double that of REST under stress.
The optimized REST implementation proved to significantly outperform the standard REST andGraphQL implementations across all metrics, proving that architectural limitations can be mitigatedthrough implementation choices. The thesis concludes that while GraphQL provides excellent clientside flexibility, a well-optimized REST architecture remains the most performant and resource-efficientchoice for high-concurrency applications.
Place, publisher, year, edition, pages
2026. , p. 33
Keywords [en]
REST GRAPHQL COMPARISON LOAD QUERYCOMPLEXITIES
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:mdh:diva-78723OAI: oai:DiVA.org:mdh-78723DiVA, id: diva2:2090710
Subject / course
Computer Science
Presentation
2026-06-05, Västerås, 15:00 (English)
Supervisors
Examiners
2026-08-172026-08-082026-08-17Bibliographically approved