database-design-patterns

Provides guidance on relational database schema design, normalization, indexing, and safe migration patterns.

181|30|Updated Nov 16, 2025
One-click install
npx skills add https://github.com/curiositech/some_claude_skills --skill database-design-patterns-curiositech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design-patterns
Source: https://github.com/curiositech/some_claude_skills/tree/main/.claude/skills/database-design-patterns
Command: npx skills add https://github.com/curiositech/some_claude_skills --skill database-design-patterns-curiositech

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexities of designing relational database schemas, ensuring optimal performance, maintainability, and safety for your data structures.

Core Features & Use Cases

  • Schema Design: Guides you through normalization (1NF, 2NF, 3NF) and denormalization decisions.
  • Indexing Strategies: Recommends appropriate index types (B-tree, GIN, GiST) and configurations (partial, covering) for various query patterns.
  • Migration Safety: Provides patterns for zero-downtime schema migrations, including the expand-contract method and safe NOT NULL additions.
  • Use Case: When designing a new e-commerce platform, use this Skill to determine the optimal schema for products, orders, and users, including appropriate indexes to ensure fast product searches and order lookups.

Quick Start

Use the database-design-patterns skill to help decide whether to normalize or denormalize the users table.

Frequently Asked Questions about database-design-patterns

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

FAQPage Schema
How do I design a relational database schema for optimal query performance?

Relational database schema design involves applying normalization (1NF, 2NF, 3NF) and targeted denormalization to structure data. This ensures optimal query performance, maintainability, and safety for your data structures.

What are the best indexing strategies for fast SQL product searches and lookups?

SQL indexing strategies recommend appropriate B-tree, GIN, or GiST index types and configurations like partial or covering indexes. These optimize query performance for various search and lookup patterns.

How can I perform zero-downtime database migrations in production?

Zero-downtime database migrations use patterns like the expand-contract method and safe NOT NULL additions. These patterns ensure safe schema changes without interrupting production system availability.

When should I normalize versus denormalize my database tables?

Normalize database tables to ensure data integrity and reduce redundancy, or denormalize strategically to optimize read performance. Decision trees guide these normalization choices for practical application.

What is the expand-contract pattern for safe schema migrations?

The expand-contract pattern is a zero-downtime migration method that separates schema changes into expand and contract phases. It allows safe modifications like NOT NULL additions without breaking production systems.