database-design

Guides database selection, schema design, indexing, and query optimization decisions.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Choosing the wrong database, ORM, or schema structure early in a project leads to performance bottlenecks, painful migrations, and costly rewrites. This Skill provides decision frameworks and validation tooling to make informed database architecture choices based on actual project context. ## Core Features & Use Cases - Database & ORM Selection: Decision trees comparing PostgreSQL, Neon, Turso, SQLite, PlanetScale, and ORMs like Drizzle, Prisma, and Kysely based on deployment environment and query complexity. - Schema Design & Indexing Guidance: Principles for normalization, primary key selection, timestamp strategy, foreign key behavior, and composite index ordering. - Schema Validation Script: A Python script that scans Prisma schemas for missing IDs, timestamps, naming violations, and missing indexes on foreign keys. - Use Case: When starting a new serverless app, use this Skill to decide between Neon and Turso, pick Drizzle as the ORM, design a normalized schema with proper indexes, and validate the Prisma schema before committing. ## Quick Start Ask the agent to help design a database schema for your project and validate the existing Prisma schema for common issues.

Frequently Asked Questions about database-design

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

FAQPage Schema
How do I choose between PostgreSQL, Neon, Turso, and SQLite?▼

Choose based on deployment context: PostgreSQL for full relational features, Neon for serverless PostgreSQL with branching, Turso for edge deployment with low latency, and SQLite for simple embedded or local apps. The decision tree in the references maps requirements to the right database.

Drizzle vs Prisma vs Kysely: which ORM should I use?▼

Drizzle fits edge deployments where bundle size matters, Prisma offers the best developer experience with schema-first migrations, and Kysely provides type-safe SQL building with maximum control. The choice depends on your deployment target and DX priorities.

How do I fix N+1 query problems in my application?▼

N+1 problems are solved with JOINs to fetch related data in one query, ORM eager loading, DataLoader for batching in GraphQL, or subqueries. Use EXPLAIN ANALYZE first to confirm the query pattern before optimizing.

How do I perform zero-downtime database migrations?▼

Never make breaking changes in one step: add columns as nullable then backfill, create indexes with CREATE INDEX CONCURRENTLY, and rename columns by adding the new column, migrating data, then dropping the old one. Always test migrations on a data copy first.

What does the schema validator script check in Prisma schemas?▼

The schema_validator.py script checks Prisma schemas for PascalCase model naming, missing @id fields, missing createdAt timestamps, and foreign keys lacking @@index declarations. It outputs a JSON report with issues found per schema file.

When should I denormalize my database schema?▼

Denormalize when read performance is critical, data rarely changes, related data is always fetched together, or simpler queries are needed. Normalize when data repeats across rows or updates would require changes in multiple places.