database-design

Design normalized relational and NoSQL database schemas with indexes and migrations.

1|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill database-design-pascallammers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/pascallammers/mylo-travel-concierge-v2/tree/main/.factory/skills/database-design
Command: npx skills add https://github.com/pascallammers/mylo-travel-concierge-v2 --skill database-design-pascallammers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you design efficient, scalable, and well-structured database schemas, ensuring data integrity and optimizing query performance for both relational and NoSQL databases.

Core Features & Use Cases

  • Schema Design: Create normalized or denormalized schemas, define tables, columns, and data types.
  • Relationships & Keys: Implement primary, foreign, and unique keys to enforce relationships.
  • Indexing: Strategically add indexes (single, composite, partial, full-text) to speed up queries.
  • SQL vs NoSQL: Guidance on choosing the right database type for your use case.
  • Query Optimization: Techniques to identify and fix slow queries, avoid N+1 problems, and implement pagination.
  • Migrations: Strategies for safe schema and data migrations using tools like Prisma.
  • Advanced Patterns: Implement soft deletes, audit trails, and polymorphic associations.

Quick Start

Use the database-design skill to create a normalized schema for an e-commerce application with customers, products, and orders tables.

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 with proper indexing and relationships?

To design a database schema, you create normalized or denormalized tables, define primary and foreign keys to enforce relationships, and strategically add single, composite, or partial indexes to optimize query performance.

What's the best way to decide between SQL and NoSQL for my application backend?

Deciding between SQL and NoSQL involves evaluating your data structure and scalability needs, using SQL for normalized relational data and NoSQL for flexible schemas, ensuring optimal data integrity and performance.

How do I fix slow queries and avoid the N+1 problem in my database?

To fix slow queries and avoid the N+1 problem, you apply query optimization techniques like strategic indexing, optimizing join operations, and implementing proper pagination to reduce database load.

Can I use database migrations to safely update my schema without downtime?

Yes, you can use database migration strategies to safely update schemas and data, utilizing tools like Prisma to execute structural changes while maintaining data integrity and application availability.

When should I implement soft deletes and audit trails in my database design?

You should implement soft deletes and audit trails as advanced patterns in your database design when you need to retain historical data, track changes over time, and ensure recoverability without permanently deleting records.