Infrastructure
Proxies, gateway management, object storage, and network segmentation for AntiRaid production deployments.
AntiRaid's infrastructure layer sits between the Discord API and the internal services. It handles rate limiting, gateway sharding, object storage, and external traffic routing.
Components
| Component | Purpose |
|---|---|
| nirn-proxy | Discord REST proxy — rate limits requests, rewrites endpoints, and acts as a security boundary between services and the Discord API |
| Sandwich-Daemon | Discord gateway manager — handles sharding, connection pooling, and presence; exposes a unified gateway API to the bot |
| Nginx | Reverse proxy — routes external HTTPS traffic to internal services and SeaweedFS |
| SeaweedFS | S3-compatible object storage — stores server backups and uploaded files |
Network architecture
All internal services run on a private Docker network (or equivalent systemd network namespace). Only Nginx is exposed to the public internet. This means:
- External clients talk to Nginx → Nginx routes to the API
- The bot talks to nirn-proxy → nirn-proxy talks to Discord
- Backup jobs write to SeaweedFS → SeaweedFS is not publicly reachable
Rate limiting is enforced at nirn-proxy before requests reach Discord, so individual services don't need to implement their own Discord rate limit logic.
Scaling
Sandwich-Daemon handles horizontal shard scaling. If your bot grows beyond a single shard, configure the shard count in Sandwich-Daemon's config — the bot itself doesn't need to change.
For object storage at scale, SeaweedFS can be replaced with any S3-compatible service (AWS S3, Cloudflare R2, etc.) by updating the storage endpoint and credentials in the service configs.