Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dauquangthanh avatar

Database Design

  • 25 installs
  • 14 repo stars
  • Updated January 23, 2026
  • dauquangthanh/hanoi-rainbow

Database Design is an agent skill that guides relational and NoSQL schema modeling so developers can implement scalable, integrity-conscious databases with sound indexing.

About

Database Design is a Hanoi Rainbow skill that walks from requirements and conceptual ERDs through logical normalization to physical types, indexes, and constraints. Reach for it when starting a new service datastore, revising entity relationships, or optimizing schema before migrations. It focuses on design principles and DDL patterns, not executing large-scale engine migrations—that is database-migration.

  • Requirements-to-ERD workflow
  • Normalization with pragmatic denormalization guidance
  • Indexing tied to query patterns
  • Examples for PostgreSQL, MySQL, MongoDB

Database Design by the numbers

  • 25 all-time installs (skills.sh)
  • Ranked #537 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dauquangthanh/hanoi-rainbow --skill database-design

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs25
repo stars14
Last updatedJanuary 23, 2026
Repositorydauquangthanh/hanoi-rainbow

How should tables, relationships, types, and indexes be shaped to meet requirements without early performance or integrity mistakes?

Models schemas, normalization, indexes, and constraints for SQL and NoSQL databases from requirements through physical design.

Who is it for?

Developers designing new schemas or revising data models for PostgreSQL, MySQL, MongoDB, or similar engines.

Skip if: Teams only moving data between engines without redesign needs, or analytics-only pipeline work without schema design.

When should I use this skill?

You are creating or revising database schemas, ERDs, normalization, or indexing strategy.

What you get

A validated schema design with entity relationships, constraints, index plan, and implementation-oriented DDL guidance.

Files

SKILL.mdMarkdownGitHub ↗

Database Design

Overview

Provides comprehensive guidance for designing robust, scalable, and maintainable database schemas for both relational (SQL) and NoSQL databases, from conceptual modeling to physical implementation.

Design Workflow

1. Requirements Analysis - Gather data requirements and usage patterns 2. Conceptual Modeling - Create entity-relationship diagrams (ERD) 3. Logical Modeling - Define normalized schema with relationships 4. Physical Modeling - Select data types, indexes, and constraints 5. Validation - Review design against requirements and best practices

Quick Start

Basic E-commerce Schema:

-- Users table
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  password_hash VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Products table
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name VARCHAR(255) NOT NULL,
  description TEXT,
  price DECIMAL(10,2) NOT NULL,
  stock_quantity INTEGER DEFAULT 0,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX idx_name (name)
);

-- Orders table
CREATE TABLE orders (
  id SERIAL PRIMARY KEY,
  user_id INTEGER REFERENCES users(id),
  total_amount DECIMAL(10,2) NOT NULL,
  status VARCHAR(50) DEFAULT 'pending',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  INDEX idx_user_created (user_id, created_at)
);

Core Principles

  • Start normalized, denormalize only when proven necessary
  • Index strategically based on actual query patterns
  • Use constraints to enforce data integrity at database level
  • Choose appropriate data types to optimize storage and performance
  • Plan for growth with partitioning and sharding strategies
  • Document design decisions and their rationale
  • Test with realistic data volumes

When to Load References

  • Design Workflow: See database-design-workflow.md for step-by-step design process including requirements analysis, conceptual/logical/physical modeling, normalization steps, and relationship patterns
  • Advanced Patterns: See advanced-design-patterns.md for many-to-many relationships, inheritance/polymorphism, temporal data, soft deletes, audit trails, and hierarchical data
  • NoSQL Design: See nosql-database-design.md when designing MongoDB documents, Cassandra column families, or Redis data structures
  • Anti-Patterns: See common-anti-patterns-to-avoid.md to identify EAV pattern issues, generic tables, redundant data, multi-value columns, and other problematic designs
  • Performance: See performance-optimization.md for query optimization, partitioning strategies, caching patterns, and index tuning
  • Migration: See schema-migration-best-practices.md for zero-downtime migrations, backward compatibility, and rollback strategies
  • Checklist: See database-design-checklist.md for comprehensive validation before implementation

Related skills

FAQ

Does it cover NoSQL as well as SQL?

Yes—the overview includes both relational and NoSQL modeling approaches.

Should schemas always be fully normalized?

The skill advises starting normalized and denormalizing only when proven necessary.

Is migration execution included?

Design covers migration thinking at schema level; engine moves use the database-migration skill.

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.