Skip to content

Technology Gateways and Key Management

mavrovde edited this page Nov 13, 2026 · 2 revisions

Technology: Gateways and Key Management

Part of the Technology Evaluation. Should keys, limits and routing live in a separate gateway or key service, or in the API itself?

Decision

At the first stage, keys, limits, tiers and the licence gate live in the API process, and the existing TLS edge in front of it adds only a coarse per-IP ceiling and body-size limits. Reasons:

  • A gateway adds a container, its own configuration language and its own memory, and still knows nothing about licences.
  • Priority admission must sit next to the database pool to work; a gateway cannot see the pool.
  • Key handling for this API (hashed keys, scopes, expiry, rotation, revocation, audit) is a few hundred lines of well-tested code.
  • No third party should hold key-holder data.

Summary

Option Verdict Reason
Existing TLS edge (reverse proxy) as a coarse guard Recommended nothing new to run; per-IP ceiling and body limits
KrakenD CE Viable later light and stateless; useful with several replicas or backends
Kong Gateway OSS Rejected open-source images appear to have stopped; advanced limits are commercial
Tyk OSS Rejected requires Redis; portal is commercial
Apache APISIX Rejected etcd or standalone complexity
Envoy Rejected now operational weight; its adaptive-concurrency idea is borrowed in-process
Zuplo Rejected now managed SaaS: key-holder data with a third party, cost, lock-in
Unkey Rejected self-hosting needs several heavy stores; managed version holds key data outside our hosting

Kong Gateway (OSS)

  • An OpenResty-based gateway with key-auth and rate-limiting plugins.
  • Estimated 150–300 MB plus a database or declarative config. Kong's installation pages list an older OSS line as the latest, and community reports say newer OSS images were not published; advanced rate limiting is enterprise-only.
  • Licence. Apache-2.0 (source). Verdict: Rejected (a likely dead end for open source).

Tyk (OSS gateway)

  • A Go gateway with keys, quotas, rate limits and policies.
  • Requires Redis; the dashboard and portal are commercial.
  • Licence. MPL-2.0 (gateway). Verdict: Rejected at this scale: two extra containers and no licence awareness.

KrakenD CE

  • A stateless Go gateway with declarative JSON configuration and token-bucket limits per endpoint and per client.
  • Light (estimated 30–80 MB) and needs no database; but limits are per instance, key validation is header or JWT rather than a key store, and there are no tiers, admission or licence gate.
  • Licence. Apache-2.0. Verdict: Viable later, as a thin edge if several API replicas or backends appear.

Apache APISIX

  • An OpenResty gateway with key-auth and fixed-window counting; uses etcd or standalone YAML.
  • Estimated 100–200 MB plus etcd; the default path stores secrets in etcd.
  • Licence. Apache-2.0. Verdict: Rejected at this scale.

Traefik and Caddy middleware

  • Per-source rate-limit middleware and forward-auth. A reverse proxy already in front of the service adds nothing new to run.
  • Not key-aware without calling back into the API.
  • Licence. MIT (Traefik), Apache-2.0 (Caddy). Verdict: Recommended as a coarse edge guard only. All per-key logic stays in the API.

Envoy

  • A CNCF proxy with local and global rate limiting (the global one needs a separate service, usually with Redis) and an adaptive-concurrency filter.
  • Best-in-class overload controls, but heavy to operate for one backend.
  • Licence. Apache-2.0. Verdict: Rejected now. The adaptive-concurrency idea is planned in-process instead.

Zuplo

  • A managed, programmable edge gateway with key management, a developer portal and monetisation.
  • Key-holder data would sit with a third party (with data-protection paperwork), plus cost and lock-in.
  • Verdict: Rejected now. Reconsider only if self-service sign-up becomes a goal.

Unkey

  • An open-source key and rate-limit service, managed or self-hosted.
  • Self-hosting needs MySQL, Redis, ClickHouse and a vault service: far too heavy for the first stage's footprint. The managed version places key metadata outside our own hosting.
  • Licence. AGPL-3.0 (to verify). Verdict: Rejected.

Key handling in the API

See Security and Access Keys for the design: high-entropy keys with checksum and prefix, HMAC with a pepper, scopes per source family, expiry, rotation with overlap, immediate revocation, audit log.

Sources

Home

About

Design

Data Model

Technical specification

Testing

Engineering

Technology choice

Reference

Clone this wiki locally