Skip to main content
ARCHOS 525 BLUEPRINT · /d/pilot-rate-limiter

Rate limiter system

11 COMPONENTS · 10 FLOWS · UPDATED 2026-11-19
GITHUB README / PR PREVIEW CARD
[![Rate limiter system — ArchOS Architecture](https://archos.sageideas.dev/d/pilot-rate-limiter/opengraph-image)](https://archos.sageideas.dev/d/pilot-rate-limiter)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/pilot-rate-limiter)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/pilot-rate-limiter" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Rate limiter system — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0[("API clients")]
  sink_1[("Client consumer")]
  lb_2["Load balancer"]
  gw_3["API gateway"]
  config_4[("Limit rules")]
  limiter_5[("Rate limiter")]
  counters_6[("Counter primary")]
  replica_7[("Counter replica")]
  app_8["API workers"]
  db_9[("Orders database")]
  metrics_10[("Metrics store")]
  client_0 -->|"1. Calls · HTTPS"| lb_2
  lb_2 -->|"2a. Routes · HTTP/2"| gw_3
  lb_2 -->|"2b. Reply · HTTPS"| sink_1
  gw_3 -->|"3a. Check · gRPC check"| limiter_5
  gw_3 -->|"3b. Allow · HTTP/2"| app_8
  limiter_5 -->|"4a. Lua eval · RESP EVAL"| counters_6
  limiter_5 -.->|"4b. Counts · OTLP"| metrics_10
  app_8 -->|"4c. Commits · SQL"| db_9
  counters_6 -->|"5. Replicates · async repl"| replica_7
  config_4 -->|"Rules · push rules"| limiter_5

COMPONENT STACK (11)

  • API clientsSTATEFUL
    browsers, mobile, partners
  • Client consumerSTATEFUL
    receives allowed or 429 response
  • Load balancerSTATELESS
    terminates TLS, connection caps
  • API gatewaySTATELESS
    authenticates, asks the limiter
  • Limit rulesSTATEFUL
    per-key quotas, versioned
  • Rate limiterSTATEFUL
    token bucket, rules from config
  • Counter primarySTATEFUL
    atomic Lua script
  • Counter replicaSTATEFUL
    warm standby
  • API workersSTATELESS
    serve allowed requests
  • Orders databaseSTATEFUL
    system of record
  • Metrics storeSTATEFUL
    allow and deny counts

REQUEST & DATA FLOW (10)

  1. API clients → Load balancer (Calls)[HTTPS]
  2. Load balancer → API gateway (Routes)[HTTP/2]
  3. Load balancer → Client consumer (Reply)[HTTPS]
  4. API gateway → Rate limiter (Check)[gRPC check]
  5. API gateway → API workers (Allow)[HTTP/2]
  6. Rate limiter → Counter primary (Lua eval)[RESP EVAL]
  7. Rate limiter → Metrics store (Counts)[OTLP]
  8. API workers → Orders database (Commits)[SQL]
  9. Counter primary → Counter replica (Replicates)[async repl]
  10. Limit rules → Rate limiter (Rules)[push rules]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →