database-design

Design normalized database schemas with indexing and migration patterns.

1.1k|129|Updated Dec 17, 2025
One-click install
npx skills add https://github.com/skillcreatorai/Ai-Agent-Skills --skill database-design-skillcreatorai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/skillcreatorai/Ai-Agent-Skills/tree/main/skills/database-design
Command: npx skills add https://github.com/skillcreatorai/Ai-Agent-Skills --skill database-design-skillcreatorai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designing robust databases can be challenging without a coherent approach to schemas, normalization, and migrations. This Skill provides proven principles and patterns to help you craft scalable data models for PostgreSQL, MySQL, and NoSQL systems, with guidance on migrations, indexing, and data integrity.

Core Features & Use Cases

  • Schema design principles: normalize data with primary keys, foreign keys, and clear entity boundaries; include practical examples such as users and addresses tables.
  • Denormalization strategies for read performance when appropriate, plus guidance on when to denormalize.
  • Indexing and query optimization: design indexes for common access patterns, analyze queries, and implement safe pagination.
  • Migration patterns: zero-downtime migrations, backfills, and safe column changes with minimal disruption.
  • Data integrity and best practices: constraints, soft deletes, versioning, and documentation of decisions.

Quick Start

Create a normalized users table and an addresses table, with a foreign key constraint from addresses to users, and ensure proper constraints and defaults.

Frequently Asked Questions about database-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a scalable database schema with proper normalization?

Database schema design uses normalization to organize data with primary keys, foreign keys, and clear entity boundaries. You create separate tables like users and addresses, linking them with foreign key constraints to ensure data integrity and reduce redundancy at scale.

What's the best way to run zero-downtime database migrations?

Zero-downtime database migrations involve backfills and safe column changes to minimize disruption. By applying migration patterns that avoid locking tables during deployment, you can update schemas without taking your application offline or interrupting active user traffic.

Does this database design approach work for both SQL and NoSQL systems?

This database design approach works for PostgreSQL, MySQL, and NoSQL systems. It provides schema design principles and optimization patterns tailored to both relational and non-relational databases to ensure robust data models across different platforms.

When should I denormalize a database schema for read performance?

Denormalization should be applied when read performance demands it, trading redundant data for faster query access. Instead of strict normalization, you combine tables or duplicate data to reduce expensive joins, following specific strategies to decide when denormalization is appropriate.

How do I create indexes for common database query access patterns?

Indexing for common access patterns requires analyzing your queries and designing indexes that match those lookup conditions. By evaluating how your application retrieves data, you can build indexes that optimize read performance and implement safe pagination.