# Data Model Design

> Design data models for business domains using entity-relationship or domain-driven design. Use when modeling new domains or refactoring data structures.

- Skill: `sethdford/data-model-design` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sethdford/data-model-design`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sethdford/data-model-design/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: sethdford (https://skillmd.com/u/sethdford)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/sethdford/data-model-design

---


# Data Model Design

Design data models that correctly represent business domains and support required queries efficiently.

## Context

You are modeling a business domain in a database. The data model must reflect business semantics and perform well.

## Domain Context

Based on relational theory and domain-driven design:

- **Entities**: Things with identity (User, Order)
- **Attributes**: Properties of entities (name, email)
- **Relationships**: How entities connect (User has many Orders)
- **Normalization**: Reduce redundancy; improves write performance
- **Denormalization**: Intentionally duplicate data; improves read performance

## Instructions

1. **Identify Entities**: What are the main concepts? List with primary key.
2. **Identify Attributes**: For each entity, list properties.
3. **Define Relationships**: One-to-one, one-to-many, many-to-many.
4. **Normalize**: Remove update anomalies through normal forms.
5. **Denormalize Strategically**: Add calculated columns or tables for read performance.

## Anti-Patterns

- **Premature Normalization**: Third-normal-form everywhere. Result: slow queries. **Guard**: Design for reads; denormalize if needed.
- **Flat Tables**: No normalization; entity data scattered. Result: update anomalies. **Guard**: At least second-normal-form.

## Further Reading

- _Relational Database Design_ — normalization fundamentals
- _Domain-Driven Design_ — modeling business domains

