-
Notifications
You must be signed in to change notification settings - Fork 5
Open
2 / 72 of 7 issues completedDescription
Load Balancer Architecture
Track horizontal scaling implementation using deterministic guild sharding.
Architecture
Load Balancer → HTTP Service (stateless, 2-10 pods)
↓
hash(guildId) % NUM_PODS → Gateway Pod N
↓
SQLite + Litestream → DO Spaces
Issues
| Issue | Title | Tier | Risk | Status |
|---|---|---|---|---|
| #229 | Litestream backup sidecar | 1 | Low | Open |
| #230 | Ingress rate limiting/timeouts | 1 | Very Low | Open |
| - | - | Closed | ||
| #232 | SERVICE_MODE support | 3 | Medium | Open |
| - | - | Closed | ||
| #234 | HTTP service + deterministic routing | 3 | Medium | Open |
| #235 | Gateway StatefulSet + shard filtering | 4 | High | Open |
Dependencies
#229 (Litestream) ──┐
├── #232 (SERVICE_MODE) ── #234 (HTTP) ──┐
│ ├── #235 (Gateway)
└────────────────────────────────────────┘
Key Decision: Deterministic Sharding
Eliminated config service (#233) and PostgreSQL (#231) in favor of deterministic sharding:
const podOrdinal = hash(guildId) % NUM_GATEWAY_PODS;
const gatewayUrl = `http://gateway-${podOrdinal}.gateway-internal:3000`;Benefits: Simpler, no external state, no network lookups
Trade-off: Scaling requires coordination (all pods recalculate)
References
- PR Architecture analysis: Load balancing with SQLite constraint #228: Architecture analysis
/notes/LOAD_BALANCER_QUICK_REF.md
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels