database-design

Guide relational database design with schema, indexing, and query optimization.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/samChang72/custom-skills --skill database-design-samchang72
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/samChang72/custom-skills/tree/main/gemini/skills/database-design
Command: npx skills add https://github.com/samChang72/custom-skills --skill database-design-samchang72

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires prisma, postgresql, neon, turso, sqlite, planetScale, cockroachDB, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides guidance on designing efficient and scalable databases, helping users avoid common pitfalls and optimize their database schema.

Core Features & Use Cases

  • Database Selection: Offers a decision tree to choose the right database for different use cases.
  • Schema Design: Discusses normalization, primary keys, timestamps, and relationships.
  • Indexing: Explains when and how to create indexes effectively.
  • Migration Principles: Outlines a safe migration strategy for zero-downtime changes.
  • Query Optimization: Addresses the N+1 problem and provides optimization priorities.
  • ORM Selection: Offers a decision tree to choose the right ORM based on deployment and DX needs.
  • Use Case: A software developer needs to design a database for a new project and wants to ensure that it is optimized for performance and scalability.

Quick Start

Run the schema_validator script to validate your Prisma schema and identify potential issues.

Frequently Asked Questions about database-design

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

FAQPage Schema
How do I optimize a PostgreSQL database schema for performance and scalability?

To optimize database schema design, you should follow guidelines on normalization, primary keys, and relationships. Effective schema optimization also requires creating indexes strategically and addressing the N+1 query problem for better performance and scalability.

What is the best way to choose a relational database for my project?

The best way to choose a relational database is using a decision tree to evaluate your specific use case. You can compare PostgreSQL, SQLite, CockroachDB, and others based on deployment requirements and scalability needs to find the optimal fit.

How do I execute zero-downtime database migration safely?

Executing zero-downtime database migration safely requires following strict migration principles. This involves carefully planning schema modifications and applying safe migration strategies to avoid disrupting active database operations.

When do I need to create indexes in a relational database?

You need to create indexes in a relational database when query performance becomes a bottleneck. Effective indexing requires understanding when and how to apply indexes strategically to speed up data retrieval without unnecessarily slowing down write operations.

Does Prisma work well with PostgreSQL for query optimization?

Prisma works well with PostgreSQL for query optimization by helping mitigate the N+1 problem. Selecting the right ORM through a decision tree ensures your ORM choice aligns with your deployment needs and developer experience requirements.

Can I validate my Prisma schema to identify potential design issues?

You can validate your Prisma schema by running a schema validator script. This script identifies potential design issues in your schema structure, helping you enforce database design guidelines and ensure structural integrity before deployment.