database-design
Database design principles and decision-making. Schema design, indexing strategy, ORM selection, serverless databases.
- License 许可
- MIT
- 最近更新
- 2026-04-11
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- database-design
- risk
- safe
- source
- community
- date_added
- 2026-02-27
- description
- Database design principles and decision-making. Schema design, indexing strategy, ORM selection, serverless databases.
02 资源文件 8
- 参考文档.openskills.json267 B
- 参考文档database-selection.md1.1 KB
- 参考文档indexing.md892 B
- 参考文档migrations.md1.1 KB
- 参考文档optimization.md902 B
- 参考文档orm-selection.md771 B
- 参考文档schema-design.md1.4 KB
- 脚本scripts/schema_validator.py5.2 KB
03 SKILL.md 正文
Database Design
Learn to THINK, not copy SQL patterns.
? Selective Reading Rule
Read ONLY files relevant to the request! Check the content map, find what you need.
| File | Description | When to Read |
|---|---|---|
database-selection.md |
PostgreSQL vs Neon vs Turso vs SQLite | Choosing database |
orm-selection.md |
Drizzle vs Prisma vs Kysely | Choosing ORM |
schema-design.md |
Normalization, PKs, relationships | Designing schema |
indexing.md |
Index types, composite indexes | Performance tuning |
optimization.md |
N+1, EXPLAIN ANALYZE | Query optimization |
migrations.md |
Safe migrations, serverless DBs | Schema changes |
⚠️ Core Principle
- ASK user for database preferences when unclear
- Choose database/ORM based on CONTEXT
- Don't default to PostgreSQL for everything
Decision Checklist
Before designing schema:
- [ ] Asked user about database preference?
- [ ] Chosen database for THIS context?
- [ ] Considered deployment environment?
- [ ] Planned index strategy?
- [ ] Defined relationship types?
Anti-Patterns
❌ Default to PostgreSQL for simple apps (SQLite may suffice) ❌ Skip indexing ❌ Use SELECT * in production ❌ Store JSON when structured data is better ❌ Ignore N+1 queries
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
04 同仓库更多 Skills
tdd-workflows-tdd-refactor
Use when working with tdd workflows tdd refactor
tdd-workflows-tdd-red
Generate failing tests for the TDD red phase to define expected behavior and edge cases.
tdd-workflows-tdd-green
Implement the minimal code needed to make failing tests pass in the TDD green phase.
tdd-workflows-tdd-cycle
Use when working with tdd workflows tdd cycle
tdd-workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
tdd-orchestrator
Master TDD orchestrator specializing in red-green-refactor discipline, multi-agent workflow coordination, and comprehensive test-driven development practices.