An Experimental performance benchmarking of REST and GraphQL APIs under controlled workload conditions

Loading...
Thumbnail Image

Journal Title

Journal ISSN

Volume Title

Publisher

BUSE

Abstract

This research evaluates the performance trade-offs between REST and GraphQL APIs under controlled workloads up to 1000 concurrent Virtual Users (VUs). While GraphQL’s client-side declarative fetching successfully solves network "over-fetching" and "under-fetching" by delivering a 52.6% reduction in network payload sizes (27.0 MB vs. 57.0 MB in REST), it introduces a significant server-side processing penalty. Containerized benchmarking experiments using the k6 engine on fixed, non-elastic Ubuntu infrastructure revealed that GraphQL incurs a 170.4% increase in average response latency (31.26 ms) compared to REST (11.56 ms). Furthermore, under peak saturation, GraphQL's tail latency degraded sharply to a p95 of 126.96 ms compared to REST's highly stable 82.31 ms, indicating performance instability caused by runtime Abstract Syntax Tree (AST) parsing and resolver tree execution. Therefore, REST remains the superior choice for high-speed enterprise systems requiring low CPU overhead and predictable tail latencies. Conversely, GraphQL is strongly recommended for bandwidth-constrained, resource expensive environments such as remote edge installations or cellular IoT networks where minimizing data transmission volume outweighs localized server processing penalties.

Description

Citation

Endorsement

Review

Supplemented By

Referenced By