Database Design
Installation
SKILL.md
Database Design
Workflow
- List the invariants the data must never violate, and who owns each write path.
- Write the access patterns first: top 10 queries with expected frequency, selectivity, and sort order. Schema follows queries; indexes follow schema.
- Normalize to 3NF, then denormalize deliberately where a measured read path demands it — and record how the copy stays consistent.
- Choose keys: surrogate PK (bigint/uuidv7/ULID), natural unique constraints, and a partition key if volume or retention requires it. Prefer time-ordered IDs to avoid index bloat.
- Plan migration and rollback before writing DDL.