LLM Rate Limiting & Traffic Management Service  ·  View 17 of 24  ·  Operations

Deployment Architecture

Two active regions, three availability zones each, and the deliberate choice not to replicate rate-limit state between them.

Editable source SVG draw.io All views
Region EU-West · active
Region EU-West · active
Edge · 3 AZ
Edge · 3 AZ
L4 Load Balancer
MetalLB / cloud LB
L4 Load Balancer...
Envoy Gateway
9 pods
Envoy Gateway...
Kubernetes · data plane
Kubernetes · data plane
limiterd
60 pods · HPA on rps
limiterd...
llm-gateway
30 pods
llm-gateway...
Stateful · 3 AZ
Stateful · 3 AZ
Valkey Cluster
16 shards + replicas
Valkey Cluster...
PostgreSQL
Patroni · sync replica
PostgreSQL...
Usage plane
Usage plane
Kafka
6 brokers · KRaft
Kafka...
Flink
6 task managers
Flink...
ClickHouse
6 nodes · 2 replicas
ClickHouse...
Region US-East · active
Region US-East · active
Edge
Edge
Envoy Gateway
6 pods
Envoy Gateway...
Kubernetes · data plane
Kubernetes · data plane
limiterd
40 pods
limiterd...
llm-gateway
20 pods
llm-gateway...
Stateful
Stateful
Valkey Cluster
regional, not replicated
Valkey Cluster...
PostgreSQL
read replica
PostgreSQL...
Global services
Global services
Routing & control
Routing & control
GeoDNS + Anycast
latency routing
GeoDNS + Anycast...
Global Budget Reconciler
60 s, eventually consistent
Global Budget Reconciler...
Platform
Platform
Argo CD
GitOps, both regions
Argo CD...
Vault / OpenBao
HA, 5 nodes
Vault / OpenBao...
LLM Providers
regional endpoints
LLM Providers...
Self-hosted GPU Pool
vLLM · A100 × 16
Self-hosted GPU Pool...
primary
primary
secondary
secondary
streaming replication
streaming replication
budget sync
budget sync
private link
private link
Deployment Architecture — active/active, two regions
Deployment Architecture — active/active, two regions
Interface / broker
Interface / broker
Application we own
Application we own
Data store
Data store
Queue / topic
Queue / topic
Security / platform
Security / platform
External / third party
External / third party
synchronous
synchronous
event / async
event / async
Rate-limit counters are deliberately regional. A globally strict quota would put a cross-region round trip on the hot path; instead each region gets a share and the reconciler corrects drift every 60 s.
Rate-limit counters are deliberately regional. A globally strict quota would put a cross-region round trip on the hot path; instead each region gets a share and the reconciler corrects drift every 60 s.
v 1.0 · owner Data & AI Global Practice
v 1.0 · owner Data & AI Global Practice
Text is not SVG - cannot display

The regional decision

  • Rate-limit counters are regional and are not replicated. A globally strict quota would put a cross-region round trip on the hot path, which is a 60 to 90 ms floor against a 10 ms budget — it would defeat the entire design.
  • Each region receives a share of every tenant's quota, weighted by observed traffic, and the global reconciler corrects the split every 60 s. A tenant sending all its traffic to one region gets its full quota there within a minute.
  • PostgreSQL is a single global primary with a regional read replica. Policy writes are rare and can tolerate a cross-region write; policy reads never happen on the hot path at all.

Availability arithmetic

  • Target 99.99%, which is 52 minutes per year. Two active regions behind latency-based GeoDNS, with each region independently capable of serving the full load at degraded latency.
  • Valkey: 16 shards, one replica each, spread over 3 AZs. Loss of one AZ costs at most a third of the shards and triggers automatic replica promotion in under 15 s.
  • RTO for a full region loss is DNS-bound: 60 s TTL plus resolver behaviour, in practice 2 to 3 minutes. RPO for usage data is 0 because Kafka is written before the response returns.

Risks

  • During a region failover, the surviving region briefly enforces only its own share of each quota, so tenants see spurious 429s until the reconciler rebalances. The reconciler runs on an accelerated 10 s cycle when a region is marked down.
  • The self-hosted GPU pool is single-region. Tenants routed to it from the other region pay cross-region latency on the completion, though not on the decision.
  • Kafka and ClickHouse are deployed in the primary region only. A primary region loss stops usage aggregation — billing catches up on recovery from the 7-day retention window, but live budget enforcement degrades to last-known values.