Backend Developer
Database Schema That Scales β From Requirements to Migration Files
Key Takeaway
The Database Design skill generates normalized schemas, indexes, constraints, and migration files from plain-text requirements. Your agent designs databases that don't fall over at 10 million rows.
The Problem
Database schema design seems simple until it isn't. Common mistakes that cost weeks to fix later:
- No indexes on foreign keys (queries go from 5ms to 5 seconds at scale)
- Wrong data types (storing prices as floats β rounding errors)
- No constraints (orphaned records, invalid states)
- Over-normalization or under-normalization
- No soft deletes (data loss is permanent)
- No audit trails (who changed what when?)
- Missing indexes for your actual query patterns
- No consideration for future sharding
These mistakes don't surface until you have 1 million rows. Then everything is slow, and migrating a production database with 50 million rows is terrifying.
The Solution
The Database Design skill generates complete schemas from domain requirements β properly normalized, indexed for your query patterns, with constraints, audit columns, and migration files.
The Process
View details
You: Design a database for a multi-tenant SaaS project
management tool. Features: organizations, projects, tasks,
users, comments, file attachments, activity log, billing.
PostgreSQL. Needs to handle 10M+ tasks across 5K+ orgs.
The agent generates:
- Complete schema with 12+ tables, all properly normalized
- Foreign keys with cascading rules
- Indexes optimized for the most common query patterns
- Composite indexes for multi-column filters
- Partial indexes for soft-deleted records
- Row-level security policies for multi-tenancy
- Audit columns (created_at, updated_at, created_by)
- Migration files (up + down)
- Seed data for development
Key decisions the agent makes (and documents why):
BIGINTfor IDs (notINTβ you'll exceed 2.1B)NUMERIC(12,2)for money (notFLOAT)TIMESTAMPTZfor all timestamps (notTIMESTAMP)- UUID for public-facing IDs (not auto-increment)
organization_idon every table (tenant isolation)- GIN indexes on JSONB columns
- Partial indexes:
WHERE deleted_at IS NULL
The Results
| Metric | "Just build tables" | AI-Designed Schema |
|---|---|---|
| Query performance at 10M rows | Degraded (missing indexes) | Optimized |
| Data integrity | Orphaned records, invalid states | Constraints enforce validity |
| Multi-tenancy | Application-level (leaky) | RLS policies (database-level) |
| Migration files | Manual SQL | Generated with up/down |
| Future-proofing | Redesign at scale | Designed for scale |
| Design time | 1-2 days | 20 minutes |
Setup on MrChief
yamlShow code
skills:
- database-design
- data-pipeline # For ETL considerations
Related case studies
SRE
Ansible Playbook for 50 Servers β Configure Everything in One Run
The Ansible skill generates complete playbooks for server configuration, application deployment, and infrastructure management. Describe what you need across your fleet, get idempotent, tested playbooks that configure 50 servers as easily as 1.
Backend Developer
API Design That Developers Actually Love β RESTful Done Right
The API Design skill generates complete RESTful API specifications β OpenAPI 3.1 schemas, endpoint design, authentication flows, pagination strategies, error handling, rate limiting, and versioning. Your agent designs APIs that follow industry best practices so your consumers don't hate you.
Founder
Business Plan in 2 Hours β Not 2 Weeks
The Business Plan skill generates comprehensive business plans β executive summary, market analysis, business model, financial projections, competitive landscape, go-to-market strategy, and risk analysis. From idea to investor-ready document.
Want results like these?
Start free with your own AI team. No credit card required.