Database Design

Installation
SKILL.md

Database Design

Workflow

  1. List the invariants the data must never violate, and who owns each write path.
  2. Write the access patterns first: top 10 queries with expected frequency, selectivity, and sort order. Schema follows queries; indexes follow schema.
  3. Normalize to 3NF, then denormalize deliberately where a measured read path demands it — and record how the copy stays consistent.
  4. 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.
  5. Plan migration and rollback before writing DDL.

Modeling rules

Installs
–
First Seen
–