← ClaudeAtlas

database-designlisted

Design a database schema and storage strategy — normalization vs. denormalization, indexing, SQL vs. NoSQL choice, sharding/replication and consistency model — with every trade-off stated explicitly rather than defaulted by habit or fashion. Use when designing a new schema, choosing a database technology, or reviewing an existing schema for scaling or correctness issues.
hemapriyan-rk/claude-rigor-skills · ★ 1 · API & Backend · score 74
Install: claude install-skill hemapriyan-rk/claude-rigor-skills
# Database Design A schema designed from the entity-relationship diagram alone is designed from the wrong input. The ERD describes the domain; the actual read/write access pattern is what should drive the schema, indexing, and technology choice. ## Step 1 — Access pattern first Before drawing tables, list the actual queries this schema needs to serve well: what's read together, what's written together, what's queried by range vs. exact match, what needs to be fast versus what can be slow. Design from this list, not from the domain model in isolation. ## Step 2 — Normalization vs. denormalization, with a stated reason Every denormalized table needs an explicit reason tied to Step 1 (a specific hot query that needs the data pre-joined). Denormalization with no stated reason is pure inconsistency risk with no offsetting benefit — flag it as a problem, not a style choice, when found without justification. ## Step 3 — SQL vs. NoSQL as a real trade-off Decide based on the actual consistency requirement (strong vs. eventual — state this explicitly) and query flexibility need from Step 1, not team familiarity or what's trending. A document store chosen for a workload that's actually relational (many cross-entity joins in the access pattern) creates exactly the joins-in-application-code problem the choice was supposed to avoid. ## Step 4 — Indexing tied to the access pattern Every index has a write-cost — only add one that serves a query actually in the Step 1 list. Check spe