database-design

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

41|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/DevayoshaUS/Women-scholarship --skill database-design-devayoshaus
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/DevayoshaUS/Women-scholarship/tree/main/hackathon-main%20%281%29/hackathon-main/.agent/skills/database-design
Command: npx skills add https://github.com/DevayoshaUS/Women-scholarship --skill database-design-devayoshaus

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (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. ## 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 context. - Schema & Indexing Guidance: Principles for normalization, primary keys, timestamps, relationships, composite indexes, and index type selection (B-tree, GIN, HNSW). - Query Optimization & Migrations: N+1 problem solutions, EXPLAIN ANALYZE workflow, and zero-downtime migration strategies for serverless databases. - Use Case: When starting a new edge-deployed TypeScript app, use this Skill to select Turso with Drizzle, design a normalized schema with proper indexes, and validate the Prisma schema with the included validator script. ## Quick Start Ask the AI to help you choose a database and design a schema for your project, describing your deployment environment and query requirements.

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. Consider query complexity, edge requirements, and global distribution needs.

Drizzle vs Prisma: which ORM should I use?▼

Drizzle is best for edge deployment and small bundle size with SQL-like syntax, while Prisma offers better developer experience with schema-first migrations and studio tooling. Kysely suits type-safe SQL building when you want maximum control.

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

Solve N+1 problems by using JOINs to fetch related data in a single query, eager loading through your ORM, DataLoader for batching in GraphQL, or subqueries. First run EXPLAIN ANALYZE to confirm the query pattern before optimizing.

When should I add indexes to database columns?▼

Index columns used in WHERE clauses, JOIN conditions, ORDER BY, and foreign keys. Avoid over-indexing write-heavy tables, low-cardinality columns, and rarely queried columns since indexes slow down inserts.

How do I run zero-downtime database migrations?▼

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

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

The schema_validator.py script checks Prisma schemas for PascalCase model naming, missing @id fields, missing createdAt timestamps, and suggests @@index additions for foreign key columns. It outputs a JSON report and treats findings as warnings rather than failures.