Object Storage Backends in Hive Router

Dotan Simha
Dotan Simha

Hive Router now supports loading its core artifacts - the supergraph schema and the persisted documents manifest - directly from object storage. Define a backend once under the new top-level storages section, then reference it from any feature that needs to load data from it.

This is the natural fit for teams whose CI pipelines publish supergraphs and persisted documents to S3-compatible buckets - the router can now pick up new versions without redeploying and without a custom sidecar.

A reusable storages section

Storage backends are declared once and referenced by ID. The same backend can serve the supergraph, the persisted documents manifest, and any future loader without re-stating credentials or endpoints:

router.config.yaml
storages:
  artifacts: # storage id, used by other parts of the config
    type: s3
    bucket: my-router-artifacts
    region: eu-west-1

supergraph:
  source: storage
  storage_id: artifacts
  location: supergraph/current.graphql
  poll_interval: 30s

persisted_documents:
  enabled: true
  require_id: true
  storage:
    type: storage
    storage_id: artifacts
    location: persisted/manifest.json
    poll_interval: 30s

If a feature references a storage_id that is not declared, the router fails at startup - no silent misconfiguration.

Works with any S3-compatible service

Under the hood, the storage layer uses the object_store Rust crate, so any service that speaks the S3 API works out of the box:

  • Amazon S3
  • Cloudflare R2
  • MinIO
  • Google Cloud Storage (S3 interop mode)
  • Tigris, Backblaze B2, DigitalOcean Spaces
  • LocalStack for local development

Production-grade credential modes

Static keys are supported, but the recommended setup uses the credential provider that matches your runtime - no long-lived secrets in config:

credentials.typeWhen to use
staticLong-lived IAM user keys or temporary session credentials.
web_identityIAM Roles for Service Accounts (IRSA) on EKS, or any OIDC token exchange.
ecs_taskECS task IAM roles via the container credentials endpoint.
eks_pod_identityEKS Pod Identity - the newer alternative to IRSA.
instance_metadataExplicit IMDSv2 configuration for EC2 (also the default when omitted).

Omit credentials entirely on EC2 and the router uses IMDSv2 with the attached instance role.

Polling with conditional requests

When poll_interval is set, the router uses HTTP If-None-Match against the object's ETag and only re-parses when storage reports the content has changed. New supergraph or manifest versions roll out without redeploying, and unchanged polls are cheap.

Dynamic values via expressions

Bucket names, endpoints, regions, and credentials all accept expressions, so values can be resolved from environment variables at startup:

router.config.yaml
storages:
  artifacts:
    type: s3
    bucket:
      expression: env("S3_BUCKET")
    region:
      expression: env("AWS_REGION", "us-east-1")
    credentials:
      type: static
      access_key_id:
        expression: env("S3_ACCESS_KEY_ID")
      secret_access_key:
        expression: env("S3_SECRET_ACCESS_KEY")