Connecting to Hive Console in Production: A High-Availability Guide
This guide provides best practices for running Hive Gateway and Hive SDKs in a production environment, with a focus on high availability and resilience against outages.
Core Components for the Gateway or Service
Understanding the components of Hive’s infrastructure is key to configuring a resilient system.
High-Availability CDN
Hive’s CDN is responsible for delivering your schema and other artifacts to your gateways. To ensure maximum uptime, Hive provides two CDN endpoints:
- Primary CDN (
https://cdn.graphql-hive.com): Built on Cloudflare’s global network, this is the main endpoint for all CDN traffic. - Secondary CDN (
https://cdn-mirror.graphql-hive.com): A full replica of the primary CDN, running on AWS CloudFront. It serves as a fallback in the event of a partial or full Cloudflare outage.
More information:
Usage Reporting
The Usage Reporting service, which collects and processes operational data from your clients.
This service ingests data from your gateways and SDKs, providing insights into your GraphQL API’s usage. It is designed to be resilient, but in the case of an outage, the Gateway and Hive SDK will drop usage reporting temporarily to avoid exhausting your Gateway.
More information:
Mitigating Outages of Gateway and Services using SDKs
The Hive Gateway and SDKs have several features to mitigate the impact of CDN or registry outages.
Schema Polling from CDN
| Client | Status |
|---|---|
| Hive JS SDK | Supported |
| Hive Gateway | Supported |
| Hive Router | Pending |
| Apollo Router Hive Plugin | Pending |
Your gateway regularly polls the CDN for schema updates. To ensure your gateway can always fetch the latest schema, you should configure it to use both the primary and secondary CDN endpoints.
The Hive SDKs and Gateway will automatically fall back to the secondary CDN if the primary is unavailable, ensuring your gateway continues to operate with the latest schema.
Each endpoint is behind a circuit breaker that detects when the endpoint is unavailable and temporarily stop using it as the source for schema polling.
More information:
Persisted Document Resolution
| Client | Status |
|---|---|
| Hive JS SDK | Supported |
| Hive Gateway | Supported |
| Hive Router | Pending |
| Apollo Router Hive Plugin | Pending |
If you are using persisted documents, the gateway will fetch them from the CDN. As with schema polling, configuring both CDN endpoints is crucial for resilience.
The Hive SDKs and Gateway will automatically fall back to the secondary CDN if the primary is unavailable, ensuring your gateway continues to operate serving persisted documents.
Each endpoint is behind a circuit breaker that detects when the endpoint is unavailable and will stop using it as the source for resolving persisted documents.
More information:
Usage Reporting
| Client | Status |
|---|---|
| Hive JS SDK | Supported |
| Hive Gateway | Supported |
| Hive Router | Pending |
| Apollo Router Hive Plugin | Pending |
In the event of a usage reporting service outage, the Hive clients implement a circuit breaker pattern. This feature detects when the service is unavailable and temporarily stops sending usage data. Once the service recovers, the client resumes sending data, preventing data loss and avoiding overwhelming your services with failing requests.
More information: