Home / Market / database schema designer

database schema designer

Design robust, scalable database schemas for SQL and NoSQL databases. Provides normalization guidelines, indexing strategies, migration patterns, constraint design, and performance optimization. Ensures data integrity, query performance, and maintainable data models.

skill★ 34763492 dlskills.shMITInstall in CosmosUpstream Source

Documentation & Preview

Database Schema Designer

A comprehensive skill for designing production-ready database schemas with built-in best practices for both SQL and NoSQL databases.

Purpose

The Database Schema Designer skill helps you create robust, scalable database schemas by providing:

Whether you are starting a new project or evolving an existing database, this skill ensures your schema follows industry best practices and avoids common pitfalls.

When to Use

Use this skill when you need to:

Trigger Phrases

| Trigger | Example | |---------|---------| | design schema | "design a schema for user authentication" | | database design | "database design for multi-tenant SaaS" | | create tables | "create tables for a blog system" | | schema for | "schema for inventory management" | | model data | "model data for real-time analytics" | | I need a database | "I need a database for tracking orders" | | design NoSQL | "design NoSQL schema for product catalog" |

How It Works

The skill follows a four-phase process:

Phase 1: Analysis

Phase 2: Design

Phase 3: Optimize

Phase 4: Migrate

Key Features

SQL Schema Design

NoSQL Schema Design (MongoDB)

Relationship Patterns

Migration Support

Usage Examples

Basic Schema Design

design a schema for an e-commerce platform with users, products, orders

Output:

CREATE TABLE users (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE orders (
  id BIGINT AUTO_INCREMENT PRIMARY KEY,
  user_id BIGINT NOT NULL REFERENCES users(id),
  total DECIMAL(10,2) NOT NULL,
  INDEX idx_orders_user (user_id)
);

Available Commands

| Command | Purpose | |---------|---------| | design schema for {domain} | Generate a complete schema from scratch | | normalize {table} | Apply normalization rules to fix an existing table | | add indexes for {table} | Generate an index strategy for performance | | migration for {change} | Create reversible migration scripts | | review schema | Audit an existing schema for issues |

Request Tips

Include these details in your request for best results:

Prerequisites

No special tools or dependencies required. The skill generates standard SQL or NoSQL schema definitions that work with:

Output

The skill produces:

  1. Schema DDL - Complete CREATE TABLE statements with all constraints
  2. Index Definitions - Optimized indexes for your query patterns
  3. Migration Scripts - Reversible UP and DOWN migrations
  4. Mermaid Diagrams - Entity-relationship diagrams (when requested)
  5. Verification Checklist - Items to review before deploying

Verification Checklist

After designing a schema, verify:

Best Practices

Do

Avoid

| Anti-Pattern | Problem | Solution | |--------------|---------|----------| | VARCHAR(255) everywhere | Wastes storage, hides intent | Size appropriately per field | | FLOAT for money | Rounding errors | DECIMAL(10,2) | | Missing FK constraints | Orphaned data | Always define foreign keys | | No indexes on FKs | Slow JOINs | Index every foreign key | | Storing dates as strings | Cannot compare/sort properly | Use DATE/TIMESTAMP types | | Non-reversible migrations | Cannot rollback safely | Always write DOWN migration |

Key Terminology

| Term | Definition | |------|------------| | Normalization | Organizing data to reduce redundancy (1NF to 2NF to 3NF) | | 3NF | Third Normal Form - no transitive dependencies between columns | | OLTP | Online Transaction Processing - write-heavy, needs normalization | | OLAP | Online Analytical Processing - read-heavy, benefits from denormalization | | Foreign Key (FK) | Column that references another table's primary key | | Index | Data structure that speeds up queries (at cost of slower writes) | | Access Pattern | How your app reads/writes data (queries, joins, filters) | | Denormalization | Intentionally duplicating data to speed up reads |

License

MIT