scaling-architecture
Use when the user asks about game server scaling, shards, zone servers, Agones, game server fleet autoscaling or game backend capacity. Produces fleet…
от j4flmao★ 47 звёзд на GitHub
Установить scaling-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Scaling Architecture — Deep Engineering Guide
Purpose
From "hundreds playing" to "a million in a weekend": how the server fleet grows without breaking determinism, latency or cost. Skill covers zone/sharding, stateless matchmaking + stateful game pods, persistence, region/edge, observability and capacity/autoscaling.
Agent Protocol
Trigger
"game server scaling", "sharding", "zone servers", "agones", "game server autoscaling", "game backend capacity".
Input Context
- Concurrent user targets and regions
- Session length and state size
- Hosting (bare metal, Kubernetes/Agones, cloud fleet services)
Output Artifact
Fleet architecture and capacity plan. No file unless requested.
Response Format
Topology: {services and pods}
State: {where it lives}
Capacity: {CCU per server, buffer}
Scaling: {trigger and policy}
1. The Scale Model (Start Simple, Grow Recursively)
Tier 1: one game server process + one lobby = 10–200 players
Tier 2: many per-region pods; lobby → matchmaker → pod (stateful), stateless elsewhere
Tier 3: zone-sharded (an open world is units of zones), state in DB, edge relay
The rule: stateful = the game pod only; everything else stateless + horizontally scalable.
2. Stateless vs Stateful
| Service | State? | Scale |
|---|---|---|
| login / auth | token-cache only | stateless, autoscale |
| matchmaker / queue | KV session state | stateless, replica |
| lobby | KV per lobby | stateless, replica |
| game pod (sim + authoritative) | in-memory world | stateful, region pods |
| anti-cheat ledger | append-only store | stateless readers |
Stateless services scale by adding replicas (a load balancer + key reconciliation). The game pod can't split mid-match — the world is one authority. Match size and zones bound it.
3. Zone Sharding (The Open-World Pattern)
A huge world is divided into zones (usually map regions, ~200–1000 players each):
world = zone_A (pod A) | zone_B (pod B) | ...
zone boundary: players crossing migrate (state transfer + connection handoff)
Each zone runs : authoritative sim + interest management (the IM skill) + a boundary service that exchanges the edge band (entities within N m of the boundary) so players see across seamlessly.
Migration protocol:
detect crossing → freeze at zone, hand serialized entity+connections
→ zone B takes over → client reconnects to zone B pod (token re-issue)
Use interest gating to keep the handshake small (only edge entities travel, not the world).
4. Region Routing & the Edge Band
- Region = a cloud region with its own pod pool (see
references/region-and-edge.md). - Player → nearest region (measured, not claimed).
- Edge relay: a regional UDP proxy in front of game pods — hides pod IPs (DDoS protection), lets players enter a private backbone close to home, and lets you move/replace pods without changing what clients connect to. It does not remove jitter; it can only shorten the public-internet part of the path.
client → edge relay (region-local) → game pod
4.1 The Two Bandwidth Paths
| Path | Purpose | Cost |
|---|---|---|
| client → relay → pod | gameplay traffic | region-local, low |
| pod → relay → client | snapshots (interest-gated) | proportional to interest |
Keep the relay stateless (it forwards, doesn't decode) — a fleet of relays autoscale like any stateless tier.
5. State Persistence (The Durable Truth)
- The world is ephemeral (a match dies at end). Persist only: player account state (MMR, unlocks, inventory), match outcomes, cheat ledger.
- DB by shape:
- MMR/inventory (per-player small) — KV/cache with snapshots.
- Match outcomes (append) — timeseries/append.
- Blob/demo archives (wire logs) — object store.
- Golden player state = DB row; the game pod holds a working copy, writes back on end/milestone (write-behind).
- Never have a pod own the only copy of a player's progression (pod dies → lose MMR).
// end of match: worker flushes:
SaveProgress(playerId, {mmrDelta, unlocks, inventory})
// idempotent, versioned (optimistic lock per player)
6. Observability (See Everything)
Every service emits RED metrics (rate, errors, duration) plus queue depth:
| Layer | Tool shape |
|---|---|
| logs | structured JSON, sampled at 1% (heavy paths) |
| metrics | counters + histograms (p50/p95/p99) per service |
| traces | distributed spans: matchmaker→lobby→pod→relay |
| profilers | tick-time histograms per pod (§ tick-loop) |
SLOs (examples):
- queue→match < 90s p95
- pod tick p99 < 5 ms
- relay drop < 0.5%
7. Capacity & Autoscaling
- Pods are ephemeral; capacity = "pods per region" decided by predicted DAU × match rate.
- On Kubernetes, Agones models this directly:
GameServer(one match process),Fleet(a warm pool),FleetAutoscaler(buffer or webhook policy) andGameServerAllocation(the matchmaker claims a Ready server, whi
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/capacity-and-autoscaling.md
- references/observability.md
- references/region-and-edge.md
- references/state-and-persistence.md
- references/stateless-services.md
- references/zone-and-shard.md
FAQ
Что делает скилл scaling-architecture?
Use when the user asks about game server scaling, shards, zone servers, Agones, game server fleet autoscaling or game backend capacity. Produces fleet, persistence and region design with capacity math. Not for a single server tick loop (use authoritative-server) or generic web autoscaling (use devops-kubernetes-autoscaling).
Как установить скилл scaling-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scaling-architecture запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…