Discord Bot Platform  ·  View 06 of 19  ·  Structure

Layered Architecture

Six layers; nothing lower calls upward.

Editable source SVG draw.io All views
Bot side (untrusted) Bot Processes Interaction Endpoints Developer Portal Edge WebSocket Edge Front Door, L4 API Edge auth, buckets Interaction Egress isolated pool OAuth / Install Control plane Application Registry Cosmos DB Installations & Grants Command Registry Token Service Key Vault Session plane Gateway Shards AKS pods Session & Resume Redis Rate-limit Counters Redis Fan-out plane Entitlement Filter Server Partitions Event Hubs Chat service Commit Events Permission Model WSS frames pull consume Discord Bot Platform — Layered Architecture External / third party Application we own Interface / broker Data store Security / platform Queue / topic synchronous event / async Layers lower down never call upward; bots reach only the edge. v 1.0 · owner Integration Platform Architecture · date 2026-10

Decisions

  • Control plane, session plane and fan-out plane are separate so they scale and fail independently (ADR-01, ADR-05).
  • Edge is the only layer bots touch, and the only place tokens are checked.

Rationale

  • Registry is small and strong; sessions are large and rebuildable; counters are approximate.