/polymath-database:db-scaling-strategyfrom polymath-database
Choose how to scale a database, cheapest first — tune, cache, replicas, partition, shard, CQRS. Not shard-key design.
Ships in polymath-database. 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.
Scale the database in the order of reversibility and cost: remove waste, then add copies, then split — and only split when the numbers say you must. Sharding is the last rung, not the first.
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.
polymath-scalability:system-design).Not this when: the bottleneck isn't identified — run polymath-database:db-performance-triage first. Choosing the shard/partition key itself is polymath-database:partitioning-sharding; non-relational key design is polymath-database:nosql-partition-design.
polymath-sre:capacity-plan); growth rate and horizon (12–24 months).Climb the ladder; at each rung state the trigger to move up, what it buys, and what it costs to undo.
polymath-performance:caching-tradeoffs. Cost: invalidation correctness and a second failure mode.session LSN/GTID waits), replica-conflict cancellations, and it does nothing for write throughput. Max replica count and fan-out cost apply.polymath-database:data-retention-archiving), split independent domains into separate databases (aligns with service boundaries — polymath-architecture:service-decomposition), and move analytics off the OLTP primary (replica, CDC into a warehouse/lake).polymath-architecture:event-driven-design).polymath-database:partitioning-sharding; consider a natively distributed engine (CockroachDB, Spanner, Aurora Limitless, Vitess, Citus) before hand-rolled sharding.polymath-writing:adr for the big steps.DB scaling decision: payments-db (Postgres 15, primary db.r6g.4xlarge)
Limit: write IOPS 71% of provisioned at peak; storage 4.1 TB growing ~220 GB/mo; reads 82% of QPS.
Headroom (polymath-sre:capacity-plan): write ceiling at 70% hit in ~7 months; storage in ~16 months [VERIFY: growth fit].
Ladder
0 waste done — removed 3 unused indexes, fixed 2 N+1s (−18% write IOPS)
1 cache ADOPT — 14k reads/s are profile/limits lookups, staleness ≤ 30 s ok
3 read replica ADOPT — reporting + order-history reads; session-pinned after writes
4 archive ADOPT — move payments > 18 months to cold storage (≈ 55% of data)
2 scale up RESERVE — next step when write IOPS > 70% sustained (cost [TBD: price delta])
5 partition ADOPT — ledger_entries by month; retention by detach
7 shard DEFER — trigger: single-primary write ceiling inside 6 months after the above; evaluate Citus/Aurora Limitless first
Rejected: NoSQL migration — access patterns are relational (joins across ledger/accounts), no evidence the engine is the limit.
Next review trigger: write IOPS > 70% sustained 10 min, or storage > 70% of cap.
Rollback cost: replicas/cache low; partitioning medium (rewrite); sharding very high.
Owner: platform-db team. Unknowns: [TBD: managed-service max replica count and cross-region lag SLO].
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-database8 skills in this plugin
/data-retention-archivingDesign retention and archiving — tiers, partition-drop purges, legal hold, deletion requests, restore tests — for DBs, event logs, lakes./db-io-tuningCut database IO — cache and working set, read/write amplification, WAL/fsync, checkpoints, bloat, volume IOPS limits. Not plans or indexes./db-performance-triageTriage a slow or saturated database top-down (workload, waits, plans, IO, locks, pools) to ONE bottleneck. Engine-agnostic; not one query plan.Other plugins' skills for the same job