/polymath-scalability:system-designfrom polymath-scalability
Design a scalable system end to end — SLOs, capacity, API and data model, components, scaling and failure modes, trade-offs.
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.
A system design is a chain of justified trade-offs from requirements to numbers to components. Each box on the diagram exists because a number or a failure mode demanded it.
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: you are reviewing an existing architecture for scale bottlenecks — polymath-scalability:scalability-review. For decomposing into services — polymath-architecture:service-decomposition; for the written decision — polymath-writing:adr / rfc.
polymath-sre:slo-design), durability, consistency, security/compliance, cost ceiling, deadline.Missing requirement → state the assumption and the decision it drives; do not stall. In an unattended run, write the assumptions at the top and continue.
polymath-scalability:capacity-estimation — peak QPS, read/write split, bandwidth, storage over retention, fan-out. The dominant numbers pick the architecture; carry the uncertainty forward.polymath-backend:api-design-rest) and the entities, with their access patterns and the key each is looked up by. The access patterns, not the entities, choose the store (polymath-database:db-scaling-strategy, nosql-partition-design).polymath-performance:caching-tradeoffs); CDN/edge for static and cacheable responses (polymath-performance:http-edge-caching).polymath-scalability:async-workload-design, polymath-streaming:streaming-design).polymath-scalability:rate-limiting-design).polymath-performance:perf-budget). Where it doesn't fit, redesign.polymath-scalability:scalability-review lenses).polymath-architecture:resilience-design); data durability and backup/restore; regional failure (polymath-scalability:multi-region-design); poison messages and replay. State what the user sees in each failure.polymath-architecture:distributed-consistency, event-driven-design).polymath-security:auth-design), the SLIs/alerts that prove the SLOs (polymath-observability:metrics-design), deploy and rollback (polymath-release:safe-rollout), a rough unit cost per request/user and the main cost drivers.System design: notification service
Problem & scope
Send transactional + marketing notifications (push/email/SMS) for 20 M users. Non-goals: in-app inbox, A/B content tooling.
Targets
availability 99.9% (accepting a request); send latency p99 < 5 s for transactional; marketing within 15 min; at-least-once, no duplicates visible to user; RPO 0 for accepted requests, RTO 15 min.
Capacity (capacity-estimation)
peak 40k notifications/s (campaign bursts) vs 2k/s steady; 40 GB/day logs; fan-out 1 → up to 3 channels. Dominant uncertainty: burst size.
API / data
POST /v1/notifications (Idempotency-Key) → 202 + id · GET /v1/notifications/{id}
notification(id, user_id, template, status) keyed by id; per-user preferences keyed by user_id.
Design
API → validate + dedupe → outbox → Kafka (topics by channel, partition key user_id) → channel workers → providers
Priority: separate topics/consumer groups for transactional vs marketing (bulkhead; marketing can't starve OTP).
Preferences: Postgres + cache (read-through, invalidate on write); status store: DynamoDB (id pk, TTL 30 d).
Rate limiting: per-tenant at API; per-provider token bucket at workers (async-workload-design).
Critical paths
transactional: API 15 ms → outbox commit → Kafka 10 ms → worker → provider (timeout 2 s, 1 retry w/ same key) → p99 ≈ 3 s.
campaign: 40k/s burst absorbed by Kafka; marketing consumers scale to provider limits; lag SLO 15 min.
Failure modes
provider down → circuit breaker, fail over to secondary provider, queue (bounded) otherwise DLQ + replay; Kafka down → API returns 503 (not lost: outbox retains); poison message → DLQ after 3 tries.
Trade-offs
Kafka over SQS: replay + ordering per user, at cost of ops → ADR-12. Single region now; multi-region trigger: SLO > 99.95% required.
Risks / unknowns
[TBD: provider rate limits at campaign peak] → load test with sandbox providers (owner: notif team).
capacity-estimation with assumptions marked.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-scalability6 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)./multi-region-designDesign multi-region deployment — active-active vs standby, RPO/RTO, replication and conflicts, routing, failover. Not single-region HA.Other plugins' skills for the same job