Hive Router
The open-source GraphQL Federation router written in Rust. Serve your supergraph with the throughput of a systems language, full Apollo Federation compatibility and observability built in.
- MIT licensed
- Drop-in for Apollo Router
- Binary or Docker image
- 199/199Federation audit test cases passed
- ~6×the throughput of Apollo Router in our open benchmark
- ~48 msp95 latency at 50 concurrent users
- ~49 MBpeak memory under load
Benchmark figures are from our open Federation gateway benchmark on a 4 vCPU Azure VM with 50 virtual users. Rerun it yourself: every gateway, query and subgraph is in the repository.
Why Hive Router
Everything a production federation router needs, in one binary, with no license tiers.
- Built in Rust, no garbage collector
- Arena allocation, zero-copy JSON and a parallel execution model keep tail latency flat under load. No GC pauses, no runtime overhead between your clients and your subgraphs.
- Learn more
- Full Apollo Federation compatibility
- Point it at your existing supergraph and it just works. Every feature is verified against our open Federation audit before it ships, including @defer, @stream and progressive overrides.
- Learn more
- Observability built in
- OpenTelemetry traces and metrics to Hive Console, any OTLP backend, Prometheus or Datadog, plus structured logs, health probes and usage reporting to the schema registry.
- Learn more
- Security at the edge of your graph
- JWT authentication, @authenticated, @requiresScopes and @policy directives, demand control, persisted documents, CSRF and CORS protection, all configured in one YAML file.
- Learn more
- Federated subscriptions
- Real-time data over Server-Sent Events, WebSockets or multipart HTTP, negotiated from the Accept header. Entity resolution across subgraphs works for subscription events too.
- Learn more
- Works with any registry
- Load the supergraph from a file, the Hive CDN or Apollo GraphOS, and hot-reload it on change. Hive Router runs standalone; Hive Console is optional.
- Learn more
From zero to a running supergraph in three commands
No runtime to install and nothing to compile. Bring a supergraph schema, or use our demo one, and the router serves it with a GraphQL IDE on port 4000.
Full getting started guide- 1
Install
One command downloads the binary for Linux or macOS. Prefer containers? Pull ghcr.io/graphql-hive/router instead.
curl -o- https://raw.githubusercontent.com/graphql-hive/router/main/install.sh | sh - 2
Point it at your supergraph
A file, the Hive CDN or Apollo GraphOS. This is the whole config for a local file.
supergraph: source: file path: ./supergraph.graphql - 3
Run it
The router serves your federated graph on port 4000, with a GraphQL IDE at the root.
./hive_router
Federation-Compatible Gateway Benchmarks
See the results of our open-source audit for Apollo Federation Gateways.
Learn how Hive Router performs against other gateways in terms of correctness and compliance with the Apollo Federation specification
Learn about our audit and methodologyMake it yours
Extend the router, lock down what runs through it and keep your subgraphs safe.
Explore Hive 360° GraphQL Ecosystem to reach full potential
Learn moreFrequently Asked Questions
Hive Router or Hive Gateway, which one should I pick?
Both are fully open source and both are supported. Hive Router is written in Rust for teams that want the highest throughput and lowest resource usage from a standalone binary. Hive Gateway is written in TypeScript for teams that want to run inside a Node.js or serverless runtime, embed it in an existing app, or write plugins in JavaScript. They read the same supergraph and report to the same Hive Console, so you can switch later.
Can I replace Apollo Router without changing my subgraphs?
Yes. Hive Router consumes a standard Apollo Federation supergraph, so you keep your subgraphs and your composition pipeline and only swap the binary. See the compatibility overview for the directives and features covered, and the getting started guide to run it in a few minutes.
Does Hive Router support GraphQL subscriptions?
Yes. Federated subscriptions are built in, over Server-Sent Events, WebSockets or multipart HTTP, with the transport between the router and each subgraph configured independently. Read more.
How do I extend it?
Two ways. Plugins are written in Rust and compiled into the router, with hooks into the HTTP, GraphQL, query planning and execution stages. Coprocessors are external services in any language that the router calls at those same stages.
How does Hive Router integrate with my monitoring stack?
It emits OpenTelemetry traces and metrics, which you can send to Hive Console, any OTLP-compatible backend, Prometheus or Datadog, alongside structured logs, health and readiness probes and schema usage reporting. Read more.
Do I need Hive Console to use Hive Router?
No. Hive Router runs standalone with a supergraph file or a schema loaded from Apollo GraphOS. Connecting it to Hive Console adds hot-reloading from the Hive CDN, persisted documents, usage reporting and tracing in one place. Read more.
Are all Hive Router features open source?
Yes. Hive Router is MIT licensed and every feature, including subscriptions, persisted documents, JWT authentication, authorization directives, demand control, traffic shaping, coprocessors and OpenTelemetry, ships in the same binary with no license tiers. Read more.
Get your
API game right.
- Built by engineers to improve developer experience
- Driven by customers
- No vendor lock-in