design-database
Design a DB that survives real load and schema change. Opinionated, not a survey.
Process
- Workload first, entities second. Answer: read/write ratio, top 3–5 queries, 1-year volume, transactional boundaries, consistency need, query shape (point/range/join/agg/search).
- Pick the store. Default Postgres. Choose NoSQL only for a workload reason. Ref:
sql-vs-nosql.md.
- OLTP vs OLAP. Analytical → Kimball star schema (
kimball-dimensional.md). Mixed → CDC into a separate warehouse.
- Schema sketch. Entities, tables/collections with types + nullability + constraints, PK/FK, indexes (ref
indexing-tradeoffs.md), uniqueness + check constraints.
- Normalization. Default 3NF for OLTP (
normalization.md). Denormalize only the hot read path, with a documented plan to prevent drift.
- Transactions. State required isolation per multi-row operation (
transactions.md). Cross-service → saga + outbox + idempotency keys (distributed-transactions.md).
- Scale strategy. Replication topology (
replication.md), sharding key + hot-partition mitigation (sharding-partitioning.md). Don't shard prematurely.
- Schema evolution. Expand-contract, backfill, reversible migrations (
schema-evolution.md). Never drop in a single deploy.
- Ops. PITR window, RPO/RTO, backup frequency + retention, restore-drill cadence.
Reference lookup
sql-vs-nosql.md · kimball-dimensional.md · normalization.md · indexing-tradeoffs.md · transactions.md · distributed-transactions.md · replication.md · sharding-partitioning.md · schema-evolution.md
Load only the ones relevant to the current step.
Output skeleton
# Database Design: <domain>
## 1. Workload (ratio, top queries, volume, consistency)
## 2. Store choice (engine, one-paragraph justification)
## 3. Schema (tables/collections, indexes)
## 4. Transactions & consistency (isolation per op)
## 5. Scale strategy (replication, sharding, hotspots)
## 6. Schema evolution (migration plan)
## 7. Operations (backup, DR, monitoring)
## 8. Trade-offs & alternatives considered
Offer to generate a DBML diagram via the diagram skill and save to ./designs/db-<kebab-name>.md.
Source: DinoQuinten/claude-plugins — distributed by TomeVault.
1---2name: design-database3description: Proposes a database schema (SQL or NoSQL) for a given domain. Use when the user asks to "design a database", "model data for X", "build an ER", pick SQL vs NoSQL, or invokes /sdd:design-database. Grounded in DDIA and Kimball. Use when this capability is needed.4---56# design-database78Design a DB that survives real load and schema change. Opinionated, not a survey.910## Process11121. **Workload first, entities second.** Answer: read/write ratio, top 3–5 queries, 1-year volume, transactional boundaries, consistency need, query shape (point/range/join/agg/search).132. **Pick the store.** Default **Postgres**. Choose NoSQL only for a workload reason. Ref: `sql-vs-nosql.md`.143. **OLTP vs OLAP.** Analytical → Kimball star schema (`kimball-dimensional.md`). Mixed → CDC into a separate warehouse.154. **Schema sketch.** Entities, tables/collections with types + nullability + constraints, PK/FK, indexes (ref `indexing-tradeoffs.md`), uniqueness + check constraints.165. **Normalization.** Default 3NF for OLTP (`normalization.md`). Denormalize only the hot read path, with a documented plan to prevent drift.176. **Transactions.** State required isolation per multi-row operation (`transactions.md`). Cross-service → saga + outbox + idempotency keys (`distributed-transactions.md`).187. **Scale strategy.** Replication topology (`replication.md`), sharding key + hot-partition mitigation (`sharding-partitioning.md`). Don't shard prematurely.198. **Schema evolution.** Expand-contract, backfill, reversible migrations (`schema-evolution.md`). Never drop in a single deploy.209. **Ops.** PITR window, RPO/RTO, backup frequency + retention, restore-drill cadence.2122## Reference lookup2324`sql-vs-nosql.md` · `kimball-dimensional.md` · `normalization.md` · `indexing-tradeoffs.md` · `transactions.md` · `distributed-transactions.md` · `replication.md` · `sharding-partitioning.md` · `schema-evolution.md`2526Load only the ones relevant to the current step.2728## Output skeleton2930```markdown31# Database Design: <domain>3233## 1. Workload (ratio, top queries, volume, consistency)34## 2. Store choice (engine, one-paragraph justification)35## 3. Schema (tables/collections, indexes)36## 4. Transactions & consistency (isolation per op)37## 5. Scale strategy (replication, sharding, hotspots)38## 6. Schema evolution (migration plan)39## 7. Operations (backup, DR, monitoring)40## 8. Trade-offs & alternatives considered41```4243Offer to generate a DBML diagram via the `diagram` skill and save to `./designs/db-<kebab-name>.md`.4445---46> Source: [DinoQuinten/claude-plugins](https://github.com/DinoQuinten/claude-plugins) — distributed by [TomeVault](https://tomevault.io).47<!-- tomevault:4.0:skill_md:2026-05-22 -->