/polymath-scalability:multi-region-designfrom polymath-scalability
Design multi-region deployment — active-active vs standby, RPO/RTO, replication and conflicts, routing, failover. Not single-region HA.
Ships in polymath-scalability. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Going multi-region trades money, latency, and consistency for survivability and locality. Decide what failure you're buying protection from, then pick the cheapest topology that meets the RPO/RTO — and rehearse the failover.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
Not this when: multi-AZ high availability within a region meets the target — polymath-cloud:design-aws-pattern / design-azure-pattern / design-gcp-pattern; or only DR backups are needed — define RPO/RTO, then restore tests (polymath-sre:chaos-experiment).
polymath-sre:slo-design), RTO/RPO per data class, latency target by user region, residency rules, regulatory constraints, and the cost envelope.polymath-chat:post-statuspage-update) → failback (re-seed old primary, reverse replication, catch up, switch traffic back in a window). Failback is a second migration — design it, don't assume it.polymath-sre:chaos-experiment); measure actual RTO and data loss, not designed values; test split-brain fencing and the "region comes back with stale data" case. A failover never exercised will not work.Multi-region design: payments API
Driver: SLO 99.99% (regional outage budget: ~4 min/month); RTO 15 min / RPO 0 for ledger, 5 min for the rest; EU data stays in EU.
Failures covered: region outage, AZ loss. Not covered: bad deploy (canary + rollback — safe-rollout), provider-wide outage.
Topology: active-active for reads/API, single-writer per home region for the ledger.
Stateless: us-east + eu-west, each sized for 100% of its own traffic + 60% of the other's [VERIFY: load test].
Ledger: Postgres per region (home-region partitioning by customer.region); sync replica in a second AZ; async cross-region replica for DR (RPO ≈ lag, p99 2 s) → RPO 0 not met cross-region [TBD: decision — accept ~2 s RPO, or use a synchronous-commit engine and pay the commit latency].
Catalog/prefs: DynamoDB global tables (LWW acceptable; per-field merge for preferences).
Events: Kafka per region, MirrorMaker 2 mirroring; consumers idempotent; offsets translated on failover.
Cache: regional, rebuilt on failover.
Routing: global LB with deep health check (DB + queue) hysteresis 3/5; DNS TTL 30 s as fallback; automatic failover for stateless, human-approved promote for ledger with fencing (old primary demoted by revoking its storage credentials).
Hidden dependencies: IdP (global, multi-region), secrets (replicated), feature flags (cached last-known-good), CI/CD (runs from eu-west), SMS provider (single region → fallback provider).
Failover runbook: detect (3 min) → decide (5 min) → promote + shift (5 min) → verify (2 min) = 15 min target; failback in a planned window after re-seed.
Rehearsal: quarterly game day; last result [TBD]. Residency: EU PII only in eu-west stores; logs scrubbed; per-region KMS keys.
Cost: +[TBD: infra delta] (compute ×1.6, inter-region transfer, double observability) vs outage cost [TBD].
Open: [VERIFY: provider rate limits per region], [TBD: ledger RPO decision with finance].
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/async-workload-designDesign async and background processing — queue vs stream, worker sizing, idempotency, retries and DLQ, backpressure, priority lanes./capacity-estimationDo back-of-envelope sizing — QPS, bandwidth, storage, cache load, node count — via a script. Not a growth forecast (capacity-plan)./rate-limiting-designDesign rate limits and quotas — token bucket vs window, limit keys, distributed enforcement, 429 headers, fairness, rollout./scalability-reviewReview an architecture for scale bottlenecks — single writers, shared state, hot keys, fan-out — and rank what breaks first. Not new design./system-designDesign a scalable system end to end — SLOs, capacity, API and data model, components, scaling and failure modes, trade-offs.npx claudepluginhub mohammadbafkar/polymath --plugin polymath-scalability