database-design

Guide relational schema design, database and ORM selection, indexing, and zero-downtime migrations.

2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/miptah21/skills --skill database-design-miptah21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/miptah21/skills/tree/main/.agents/skills/database-design
Command: npx skills add https://github.com/miptah21/skills --skill database-design-miptah21

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires json, re, and includes scripts (resource) components.

What problem does it solve?

It helps you make correct, context-aware database design decisions so your application gets predictable performance, safe schema changes, and fewer long-term maintenance issues.

Core Features & Use Cases

  • Database and ORM selection: Choose an appropriate database (e.g., PostgreSQL vs serverless options like Neon/Supabase vs edge/embedded like Turso/SQLite) and an ORM/query approach (e.g., Drizzle vs Prisma vs Kysely vs SQL/SQLAlchemy) based on deployment and product constraints.
  • Schema design and relationship modeling: Decide when to normalize vs denormalize, select primary keys and timestamp strategy, and model relationship types (one-to-one, one-to-many, many-to-many) with correct foreign-key behaviors.
  • Performance and safe evolution: Apply indexing principles, prevent common query pitfalls like N+1, and plan zero-downtime migrations (e.g., add nullable then backfill then enforce NOT NULL; use concurrent index creation).

Quick Start

Ask an AI to design a schema for a multi-tenant SaaS app including tables, relationships, indexes, and a zero-downtime migration plan based on your deployment environment and query patterns.

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 a multi-tenant SaaS application?

To design a multi-tenant SaaS database schema, you must model relationship types with correct foreign keys, select appropriate primary keys, and apply indexing principles based on your specific query patterns to ensure predictable performance.

What is the best way to plan zero-downtime database migrations?

The best way to plan zero-downtime database migrations is to use multi-step sequences like adding a nullable column, backfilling data, and then enforcing NOT NULL, alongside using concurrent index creation to avoid locking production tables.

How do I choose between PostgreSQL and serverless databases like Turso or Supabase?

Choosing between PostgreSQL and serverless databases like Turso or Supabase requires evaluating your deployment constraints, product scale, and edge latency requirements to match the persistence layer with your application architecture.

How do I prevent N+1 query problems when selecting an ORM?

To prevent N+1 query problems during ORM selection, you should evaluate query approaches like Drizzle, Prisma, or Kysely based on their loading strategies, and apply indexing principles to optimize relationship fetching.

When should I normalize vs denormalize data in schema modeling?

You should decide when to normalize vs denormalize data based on your application's query patterns and performance requirements, balancing data integrity with read efficiency to keep schemas maintainable as they scale.

Does database design guidance help with selecting between Drizzle and Prisma?

Yes, database design guidance helps select between Drizzle and Prisma by evaluating your deployment constraints, query complexity, and the need for type-safe query building versus higher-level abstraction in your persistence layer.