database-design

Design relational and NoSQL database schemas with indexing and migration plans.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/robinxin/AIFlomo --skill database-design-robinxin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/robinxin/AIFlomo/tree/main/.claude/skills/database-design
Command: npx skills add https://github.com/robinxin/AIFlomo --skill database-design-robinxin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design robust, scalable database schemas that support clean evolution, strong data integrity, and maintainable performance across systems.

Core Features & Use Cases

  • Schema design principles: normalization, denormalization, and practical denormalization for read performance.
  • Indexing and performance: effective index strategies, constraints, and safe migration patterns.
  • Migration patterns: zero-downtime templates and backfill strategies for production deployments.
  • Data integrity: primary/foreign keys, checks, and constraints to enforce business rules.

Quick Start

Design a normalized schema for a customers-orders system and generate a safe migration plan.

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 database schema for PostgreSQL that handles read-heavy workloads?

Database schema design for read-heavy PostgreSQL workloads applies practical denormalization to optimize query performance while maintaining primary and foreign key constraints for data integrity. It balances normalization principles with strategic denormalization to reduce join overhead.

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

Zero-downtime database migrations use backfill strategies and safe migration templates to apply schema changes without locking tables or disrupting active traffic. This approach ensures production deployments maintain availability while schema evolution occurs safely in the background.

When should I use denormalization instead of normalization in schema design?

Denormalization in schema design is appropriate when read performance demands exceed write overhead tolerance, requiring duplicated data to eliminate expensive joins. Normalization remains preferred for write-heavy systems prioritizing storage efficiency and update simplicity over query speed.

Does this database design approach work with NoSQL systems or only relational databases?

This database design approach works with both NoSQL systems and relational databases including PostgreSQL and MySQL. It covers schema decisions, indexing strategies, and data integrity constraints adaptable to NoSQL contexts where flexible document structures replace rigid table relationships.

How do I enforce business rules and data integrity using database constraints?

Data integrity enforcement uses primary keys, foreign keys, check constraints, and unique constraints to validate business rules directly within the database schema. This prevents invalid data entry at the storage layer independent of application logic.

What indexing strategies should I apply for optimal query performance?

Effective indexing strategies for query performance include composite indexes for multi-column filters, partial indexes for selective queries, and constraint-backed indexes to enforce uniqueness. Proper index design reduces table scans while supporting safe migration patterns.