database-design

Design normalized database schemas with indexes, constraints, and migration strategies for SQL and NoSQL systems.

3|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Fabric-Pro/fabric-oss --skill database-design-fabric-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/Fabric-Pro/fabric-oss/tree/main/.cursor/skills/database-design
Command: npx skills add https://github.com/Fabric-Pro/fabric-oss --skill database-design-fabric-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Poorly designed database schemas lead to slow queries, data redundancy, and painful migrations. This Skill provides structured guidance for designing normalized schemas, choosing indexes, and planning safe migrations so your data layer scales reliably. ## Core Features & Use Cases - Schema Design: Create normalized tables with proper primary keys, foreign keys, relationships (one-to-many, many-to-many, self-referencing), and appropriate data types. - Query Optimization: Diagnose slow queries with EXPLAIN ANALYZE, eliminate N+1 problems, and apply strategic indexing including composite, partial, and full-text indexes. - Migration Planning: Execute safe schema changes with Prisma migrations, multi-step column swaps, and data backfill scripts. - Use Case: When building a new e-commerce feature, use this Skill to design the orders, products, and customers tables with correct relationships, add indexes for common lookup patterns, and generate a zero-downtime migration plan. ## Quick Start Ask the AI to design a normalized database schema with indexes and a migration plan for your application's data model.

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?▼

Start with third normal form by separating entities into their own tables and linking them with foreign keys. For example, split customers, products, and orders into separate tables rather than duplicating customer data on every order row.

When should I use SQL vs NoSQL databases?▼

Use SQL databases like PostgreSQL when you need complex joins, ACID transactions, and structured data. Choose NoSQL document stores for flexible schemas, key-value stores like Redis for caching, and time-series databases for metrics and logs.

How do I fix N+1 query problems?▼

Replace per-record queries with a single JOIN query that fetches parent and child records together. With Prisma, use the include option to eager-load related records in one query instead of looping through results.

Which columns should I index in PostgreSQL?▼

Index columns frequently used in WHERE clauses, JOIN conditions, and ORDER BY statements, especially those with high cardinality. Avoid indexing small tables, low-cardinality columns like booleans, and columns already covered by composite indexes.

How do I run zero-downtime database migrations?▼

Use multi-step migrations: add the new column, backfill data, then swap columns in a separate deployment. In PostgreSQL, create indexes with CREATE INDEX CONCURRENTLY to avoid locking the table during the build.

When should I denormalize my database schema?▼

Denormalize only after normalizing first and measuring actual performance bottlenecks. Common cases include caching computed aggregates or snapshotting historical values like price_at_purchase on order items to preserve accuracy.