database-design

Design normalized relational and NoSQL database schemas with migrations and indexing.

53|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/cosmix/claude-code-setup --skill database-design-cosmix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/cosmix/claude-code-setup/tree/main/skills/database-design
Command: npx skills add https://github.com/cosmix/claude-code-setup --skill database-design-cosmix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill covers database schema design, normalization, indexing, and migrations to support scalable, maintainable systems.

Core Features & Use Cases

  • Schema Design: Tables/collections, primary keys, foreign keys, and data types.
  • Indexing Strategies: Optimized queries via appropriate indexes.
  • Migrations: Reversible migrations and zero-downtime changes.

Quick Start

Design a normalized PostgreSQL schema for a simple e-commerce domain with users, products, and orders.

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 normalized database schema for relational data?

Normalized database schema design organizes tables to eliminate redundancy and dependencies through normalization levels like 3NF. Define primary keys, foreign keys, appropriate data types, and constraints to structure relational data for scalability and maintainability.

What's the best way to create indexes to optimize database query performance?

Indexing strategies identify high-frequency query patterns and apply appropriate indexes on columns used in WHERE, JOIN, and ORDER BY clauses. Proper indexing accelerates query execution without adding storage overhead or slowing write operations.

How do I perform zero-downtime database migrations without disrupting live applications?

Zero-downtime migrations execute schema changes, data transformations, and version management in reversible steps while the application continues running. This approach uses staged rollouts and backward compatibility to eliminate service interruption.

Can I apply normalization and schema design to NoSQL databases?

Schema design principles extend to NoSQL by structuring collections and documents for scalability and query efficiency. While NoSQL denormalizes differently than relational systems, thoughtful modeling prevents data duplication and maintains consistency across document or collection structures.

Why should I create an Entity-Relationship Diagram (ERD) before building a database?

An ERD visually maps entities, relationships, cardinality, and attributes before implementation, clarifying requirements and identifying design flaws early. This diagram serves as a shared blueprint for developers and stakeholders to align on data structure and dependencies.