# Data Modeling And Persistence

> Design clear data models, schemas, and persistence strategies that balance integrity, performance, and evolvability. Use when defining database schemas, choosing storage, or modeling domain data.

- Skill: `itsual/data-modeling-and-persistence` (Agent Skill)
- Install (CLI): `npx skillmds@latest add itsual/data-modeling-and-persistence`
- Raw SKILL.md: https://api.skillmd.com/api/skills/itsual/data-modeling-and-persistence/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: itsual (https://skillmd.com/u/itsual)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/itsual/data-modeling-and-persistence

---


# Data Modeling and Persistence

## Overview

Data usually outlives code. Invest in clear models, constraints, and migration strategies.

## When to Use

- Designing new tables/collections or domain models
- Choosing between relational, document, key-value, etc.
- Planning schema migrations
- Addressing data integrity or query performance issues

## Core Practices

- Model the domain first; let storage concerns inform but not fully dictate the model
- Use constraints (not just application code) to protect integrity where appropriate
- Plan for schema evolution from the start
- Index deliberately based on actual access patterns
- Consider consistency, availability, and partition tolerance trade-offs explicitly
- Separate read and write models when the complexity is justified (CQRS-style)

## Migration Discipline

- Prefer expandable, backward-compatible changes when possible
- Test migrations against realistic data volumes
- Have a rollback or forward-fix strategy

## Verification

- Critical invariants are enforced
- Common queries are efficiently supported
- Schema changes are safe and reversible or clearly one-way

