Skip to content
Skills Library
Data & analytics · Planning

db-design

/db-design

Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.

Repository
SkillCamo ↗
Licence
Apache-2.0
Last repository change
04.11.2026

Assessment and security

85/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 04.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.

Original author description

Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.

How it works

  1. When to Offer This Workflow
  2. Stage 1: Domain & Access Patterns
  3. Stage 2: Entities & Relationships
  4. Stage 3: Keys & Constraints
  5. Stage 4: Normalization Trade-offs
  6. Stage 5: Indexing & Performance
  7. Stage 6: Operations & Evolution
  8. Final Review Checklist
  9. Tips for Effective Guidance
  10. Handling Deviations
Original SKILL.md headings · 83 lines, 310 words
SKILL.md preview
---
name: db-design
description: Deep database design workflow—entities and relationships, keys and constraints, normalization vs denormalization, indexing strategy, integrity, and operational concerns. Use when designing OLTP schemas or reviewing greenfield data models.
---

# DB Design

Good OLTP design balances integrity, write paths, query patterns, and evolution—not “third normal form everywhere.”

## When to Offer This Workflow

**Trigger conditions:**

- Greenfield service schema or major new domain
- Performance or integrity issues from ad-hoc tables
- Multi-tenant isolation questions

**Initial offer:**

Use **six stages**: (1) domain & access patterns, (2) entities & relationships, (3) keys & constraints, (4) normalization trade-offs, (5) indexing & performance, (6) operations & evolution). Confirm RDBMS and scale expectations.

---

## Stage 1: Domain & Access Patterns

**Goal:** List critical queries and writes: QPS, joins, filters, hot rows.

**Exit condition:** Top access paths ranked by business importance.

---

## Stage 2: Entities & Relationships

**Goal:** ER model; cardinality; optional vs required relationships.

### Practices

- Clear table names; avoid opaque “data” blobs unless documented

---

## Stage 3: Keys & Constraints

**Goal:** Primary keys (surrogate vs natural); foreign keys with explicit ON DELETE policy; unique constraints for business rules.

### Multi-tenant

- `tenant_id` on rows that need isolation; composite keys or indexes as appropriate

---

## Stage 4: Normalization Trade-offs

**Goal:** Normalize to reduce update anomalies; denormalize read hotspots with documented trade-offs.

---

## Stage 5: Indexing & Performance

**Goal:** Indexes serve real queries; watch write amplification and index bloat.

---

## Stage 6: Operations & Evolution

**Goal:** Migration strategy (expand/contract); backup/restore; PII columns flagged.

---

## Final Review Checklist

- [ ] Access patterns drive schema
- [ ] Keys, FKs, and constraints explicit
- [ ] Multi-tenant isolation if applicable
- [ ] Normalization decisions justified
- [ ] Index plan aligned with queries
- [ ] Migration and ops considerations noted

## Tips for Effective Guidance

- NULL semantics and defaults matter for bugs and migrations.
- Pair with **db-migrate** for online schema changes.

## Handling Deviations

- Document stores: embed vs reference with consistency story.
Files in this package (2)
  • SKILL.md 2 KB
  • _meta.json 1 KB

Versions

The database has no other skills named db-design.

Database snapshot: 13.11.2026 · package version aea2e3025342 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100design-postgres-tables
    Use this skill for general PostgreSQL table design. **Trigger when user asks to:** - Design PostgreSQL tables, schemas, or data models when creating new tables and when modifying existing ones. - Choose data types, constraints, or indexes for PostgreSQL - Create user tables,…
  • 100database-design
    Database schema design and data modeling: normalization, indexing, constraints, migrations, partitioning, audit trails. Use to design or review a schema.
  • 90warehouse-and-schema-design
    Guides agents through data warehouse and schema design. Use when defining fact and dimension models, keys, grain, normalization versus denormalization, serving-layer schema boundaries, and downstream-friendly table design.
  • 100database-design
    Relational database design patterns - normalization, keys, relationships, constraints, naming, timestamps, soft deletes, migration strategy, and security/retention. Use when designing or reviewing a schema.
  • 100schema-designer
    Design database schemas with proper normalization, relationships, constraints, and indexes. Use when creating database tables, modeling data relationships, or designing database structure.
  • 85role-database:schema-design
    Database schema design principles and patterns. Normalization (1NF through 5NF/BCNF), strategic denormalization for read performance, multi-tenancy schema patterns (shared schema, schema-per-tenant, database-per-tenant), primary key strategies (UUID v7, ULID, KSUID, Snowflake…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.