Skip to content

tailcallhq/federation-example

Repository files navigation

GraphQL Federation Benchmarks

Explore and compare the performance of the fastest GraphQL federation routers through our comprehensive benchmarks.

Benchmark Results

Server Status RPS Latency
Nginx 5,065 RPS 0.0254 sec
Base
Tailcall 7,119 RPS 0.0099 sec
Grafbase 4,532 RPS 0.0192 sec
Wundegraph 3,107 RPS 0.027 sec
Apollo 2,324 RPS 0.0368 sec
Cached
Tailcall 17,609 RPS 0.009 sec
Grafbase 7,508 RPS 0.0109 sec
Wundegraph 5,380 RPS 0.0226 sec
Server Status RPS Latency
Nginx 4,658 RPS 0.0209 sec
Base
Tailcall 4,952 RPS 0.0142 sec
Grafbase 3,519 RPS 0.0241 sec
Wundegraph 1,381 RPS 0.0713 sec
Apollo 2,108 RPS 0.0408 sec
Cached
Tailcall 12,783 RPS 0.0076 sec
Grafbase 5,176 RPS 0.0174 sec
Wundegraph 2,460 RPS 0.049 sec
Server Status RPS Latency
Nginx 2,077 RPS 0.042 sec
Base
Tailcall 1,723 RPS 0.045 sec
Grafbase 1,763 RPS 0.0506 sec
Wundegraph 676 RPS 0.1419 sec
Apollo 886 RPS 0.0951 sec
Cached
Tailcall 7,013 RPS 0.0139 sec
Grafbase 2,118 RPS 0.0404 sec
Wundegraph 960 RPS 0.1166 sec

RPS Plots

Requests Per Second: small payload

Requests Per Second: medium payload

Requests Per Second: big payload

Latency 95% Plots

Latency 95%: small payload

Latency 95%: medium payload

Latency 95%: big payload

Architecture

Architecture Image

Components

  1. hey: We use hey cli benchmarking tool to cause synthetic load to benchmark the different router implementations. We benchmark for '10 secondsusing200 connections`. We constructed three different request payload configurations: big, medium, small. Each configuration queries a response of payload size of 112,838 bytes, 12598 bytes, and 362 bytes respectively.
  2. Implementations: We use a collection of different federation implementations, and for each of them, we also have different configuration setups located in the configurations folder. We benchmark each implementation with varying configurations for every data configuration setup (big, medium, small).
  3. Mock: This component provides data to the implementations. It mocks a GraphQL subgraph and an equivalent Rest API. This component is written in Rust and serves static data. We do that to eliminate any overheads caused by processing the request in a real GraphQL subgraph.

Specifications

Specifications of the machine used for benchmarking:

Platform: Linux x64
Size:
2-cores · 8 GB RAM · 75 GB SSD

Quick Start

  1. Clone the repository

    git clone [email protected]:tailcallhq/federation-example.git
    cd federation-example
  2. Ensure you have the latest version of Docker

  3. Run the following command:

    docker build -t tailcallhq/federation-benchmark .
    docker run tailcallhq/federation-benchmark:latest ./benchmark_all.sh
  4. Wait for benchmarks to complete.

Resources

  • Docker: Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers.
  • Hey: hey is a tiny program that sends some load to a web application.
  • Rust: Rust is a general-purpose programming language emphasizing performance, type safety, and concurrency. It enforces memory safety, meaning that all references point to valid memory.
  • GraphQL Federation: GraphQL Federation is an architecture that allows multiple independent GraphQL services to form a unified graph that appears as a single graph to clients. It is a powerful way to scale and manage microservices architecture when using GraphQL.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages