/polymath-database:data-retention-archivingfrom polymath-database
Design retention and archiving — tiers, partition-drop purges, legal hold, deletion requests, restore tests — for DBs, event logs, lakes.
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.
Data you keep forever costs forever — in storage, backup time, query speed, and legal exposure. Decide per data class how long it lives, where it sits as it ages, and how it dies.
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're choosing broker partitioning or compaction mechanics only — polymath-streaming:streaming-design. For compliance control mapping — polymath-security:compliance-mapping.
[TBD: owner/legal].polymath-database:partitioning-sharding) — O(1) and no bloat — instead of massive DELETE (bloat, WAL, replica lag). If unpartitioned, delete in bounded batches with throttling, an index on the age column, and vacuum headroom; archive-then-delete in the same job with verification.retention.ms, Event Hubs retention) for replay windows; compaction for latest-state-per-key; tiered storage for long Kafka retention; sink to the lake (Kafka Connect, Event Hubs Capture, Auto Loader) as the long-term record rather than extending broker retention. State what replay needs, and what breaks if a consumer is offline longer than retention (polymath-streaming:kafka-performance-tuning for lag).VACUUM in Delta, expire_snapshots in Iceberg), partition lifecycle, object-store lifecycle rules, and compaction before archival (polymath-streaming:data-lake-layout).polymath-database:nosql-partition-design), mind asynchronous deletion and tombstones.polymath-security:crypto-review), immutable/WORM storage when required, a catalog entry (what, when, where, how to restore), and a restore test on a schedule — an untested archive is a hope.Retention & archiving plan: payments platform
Class Where Floor (why) Ceiling Tiering / mechanism
payment_events Postgres ledger 7 y (financial records) [TBD: confirm w/ finance] 10 y hot 13 mo (partitions) → cold Parquet on S3 → IA after 3 y → delete at 10 y
order_events (Kafka) orders.order-events replay window 7 d 7 d broker retention 7 d; sink to lake (Connect) = long-term record; compacted orders.order-state
app logs OpenSearch 30 d (incident analysis) 90 d ILM: hot 7 d → warm 30 d → delete 90 d; sample DEBUG
user PII (profile) users DB + CDC life of account +30 d after closure erase on request ≤ 30 d; backups age out ≤ 35 d; lake copies tokenized
Archive: Parquet + schema file + manifest (catalog table `archive_catalog`); SSE-KMS key retained while data retained; restore test quarterly (last: [TBD]).
Deletion propagation: DB → CDC tombstone → lake MERGE delete + search index delete; caches expire ≤ 24 h.
Legal hold: `legal_hold` table checked by purge job; test "held rows survive purge" in CI.
Purge job: monthly partition detach → verify row count + checksum in archive → drop; dry-run flag; alert if > 2× expected rows.
Payoff: ledger shrinks ≈ [TBD: from size histogram]; backup window and restore time follow.
Open: [TBD: legal minimum for chargeback evidence], [VERIFY: Kafka tiered storage availability on current cluster version].
DELETE, wherever volume is large.DELETE FROM … WHERE created_at < … on a hot table.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mohammadbafkar/polymath --plugin polymath-database8 skills in this plugin
/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./db-scaling-strategyChoose how to scale a database, cheapest first — tune, cache, replicas, partition, shard, CQRS. Not shard-key design.Other plugins' skills for the same job