| name | database-schema-designer |
| description | This skill should be used when designing database schemas for SQL or NoSQL databases. It provides normalization guidelines, indexing strategies, migration patterns, and performance optimization. |
| argument-hint | [domain or requirements] |
| allowed-tools | Read |
| agent | database-designer |
| context | fork |
| metadata | {"triggers":"database schema, schema design, SQL design, NoSQL design, ERD, database design, create tables, model data, data modeling","related-skills":"architecture-design, java-spring-api, nestjs-api, python-dev","domain":"infrastructure","role":"architect","scope":"design","output-format":"document"} |
| last-reviewed | 2026-03-14 |
Iron Law
NO SCHEMA MIGRATION WITHOUT A DOWN (ROLLBACK) SCRIPT AND AN INDEX ON EVERY FOREIGN KEY — unindexed FKs cause full table scans; irreversible migrations cause production incidents
Database Schema Designer
Design production-ready database schemas with best practices built-in.
Triggers
| Trigger | Example |
|---|
design schema | "design a schema for user authentication" |
database design | "database design for multi-tenant SaaS" |
create tables | "create tables for a blog system" |
schema for | "schema for inventory management" |
model data | "model data for real-time analytics" |
I need a database | "I need a database for tracking orders" |
design NoSQL | "design NoSQL schema for product catalog" |
Quick Reference
| Task | Approach | Key Consideration |
|---|
| New schema | Normalize to 3NF first | Domain modeling over UI |
| SQL vs NoSQL | Access patterns decide | Read/write ratio matters |
| Primary keys | INT or UUID | UUID for distributed systems |
| Foreign keys | Always constrain | ON DELETE strategy critical |
| Indexes | FKs + WHERE columns | Column order matters |
| Migrations | Always reversible | Backward compatible first |
Process
Phase 1: Analyze
- Identify entities and relationships
- Determine access patterns (read-heavy vs write-heavy)
- Choose SQL or NoSQL based on requirements
Phase 2: Design
- Normalize to 3NF (SQL) or determine embed/reference strategy (NoSQL)
- Define primary keys and foreign keys
- Choose appropriate data types -- read
reference/data-types-reference.md for type guides