/polymath-database:nosql-partition-designfrom polymath-database
Design NoSQL access patterns and partition keys (DynamoDB, Cassandra, Cosmos, Mongo) — hot partitions, indexes, throughput, TTL.
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.
In key-value and wide-column stores you model the queries, not the entities. The partition key decides throughput ceiling, latency, and cost — and can't be changed without a migration.
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.
ProvisionedThroughputExceeded, 429 / RequestRateTooLarge), a hot partition, large partitions, or runaway cost.Not this when: the store is relational and the question is sharding — polymath-database:partitioning-sharding. Index design in a relational engine — polymath-database:index-strategy.
Query returns an aggregate with its children (single-table design in DynamoDB; wide rows in Cassandra).device#2025-10), by hash suffix, or cap and roll over. Choose bucket size from measured volume, with a plan for readers to enumerate buckets.item#0..N) trades one hot partition for N reads to aggregate; cache or CDN hot reads (DAX / app cache) before sharding keys; queue and batch write bursts. Adaptive capacity helps imbalance, not a single hot key.LOCAL_QUORUM vs ONE, Cosmos levels). State the choice per pattern and the multi-region implication.gc_grace_seconds and time-window compaction), export/archive to the lake (polymath-database:data-retention-archiving), and a backup/point-in-time-recovery setting.polymath-database:db-scaling-strategy).NoSQL model: device telemetry + device registry (DynamoDB, on-demand → provisioned later)
Access patterns
A1 get device profile pk=DEVICE#<id>, sk=PROFILE 3k/s read p99 < 10 ms
A2 latest N readings for a device pk=DEVICE#<id>#<yyyymm>, sk=TS#<iso>, rev 20k/s write 6k/s read
A3 devices in a site GSI1 pk=SITE#<id>, sk=DEVICE#<id> 50/s read
A4 all devices with open alert sparse GSI2 pk=ALERT#open, sk=<site>#<id> + write-shard suffix (0–7) 5/s read
Keys
Reading partitions bucketed per device-month: bounds partition size (≈ 21 MB/month at 1 reading/min × 0.5 KB [VERIFY: measured item size]); readers enumerate ≤ 2 buckets for "latest".
Hot-key check: top device = 0.02% of writes; site GSI top site = 3% (acceptable) — [VERIFY quarterly].
Alerts index is sparse and write-sharded (8 suffixes) so one `ALERT#open` key can't throttle; A4 reads 8 keys in parallel.
Consistency: A1 strongly consistent read after registration; A2/A3 eventual.
Capacity: A2 20k writes/s × 0.5 KB items → [TBD: units from vendor formula] + GSI writes; per-partition write share ≈ 20k/(devices spread) — within limits because pk spreads across 120k devices.
Lifecycle: TTL 90 d on readings; nightly export to S3 (Parquet) for analytics; PITR on.
Rejected: single "readings" partition per site (hot, unbounded); scan for open alerts (cost).
[TBD].status, date) — one partition takes all the writes.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