database-design

Design database schemas, indexes, queries, and migrations for SQL and NoSQL systems.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Elric412/Leica-cam --skill database-design-elric412
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/Elric412/Leica-cam/tree/main/.agents/skills/database-design
Command: npx skills add https://github.com/Elric412/Leica-cam --skill database-design-elric412

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, production-minded approach to designing and evolving database schemas so applications run reliably and efficiently while preserving data integrity and minimizing downtime during changes.

Core Features & Use Cases

  • Schema modeling & normalization: identify entities and relationships, apply 1NF–3NF, and evaluate safe denormalization when justified by measured performance needs.
  • Indexing & query optimization: choose index types and composite/partial/covering indexes to match query patterns and interpret EXPLAIN plans to remove sequential scans and slow joins.
  • Migration & deployment patterns: plan zero-downtime migrations with add-backfill-switch-drop steps, create indexes concurrently, and validate rollbacks.
  • Operational guidance: mitigate N+1 queries with eager loading or batching, select connection pool sizing, and apply ORM best practices and bulk operations.
  • Use case: optimize a high‑traffic orders system by modeling order_items, adding targeted composite indexes, converting offset pagination to keyset cursors, and deploying migrations safely.

Quick Start

Ask the database-design skill to review the current schema for the users and orders tables, recommend normalization or denormalization changes, and provide an index plan and zero-downtime migration steps.

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 and apply normalization rules?

Database schema design involves identifying entities and relationships, applying normalization 1NF–3NF to ensure data integrity, and evaluating strategic denormalization only when justified by measured performance needs.

What's the best way to optimize slow database queries and fix N+1 issues?

Query optimization is achieved by selecting B-tree, GIN, or BRIN index types, interpreting EXPLAIN plans to remove sequential scans, and mitigating N+1 queries through ORM eager loading or batching patterns.

How do I run zero-downtime database migrations and create indexes concurrently?

Zero-downtime database migrations follow an add-backfill-switch-drop pattern, creating indexes concurrently to avoid table locks, and validating rollback procedures to ensure continuous availability.

When do I need to use composite or covering indexes for query tuning?

Composite or covering indexes are needed when matching specific query patterns to remove slow joins and sequential scans, often replacing offset pagination with keyset cursors for high-traffic systems.

Does this database design approach work for both SQL and NoSQL systems?

Yes, the database design approach works for both SQL and NoSQL databases, applying indexing strategies, connection pooling, and ORM-friendly bulk operations across transactional and analytical systems.