database-design

Guide relational schema design covering normalization, primary keys, timestamps, and indexing.

1|Updated Dec 28, 2025
One-click install
npx skills add https://github.com/barbosakjn/finance-app --skill database-design-barbosakjn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/barbosakjn/finance-app/tree/main/.agent/workflows/.agent/skills/database-design
Command: npx skills add https://github.com/barbosakjn/finance-app --skill database-design-barbosakjn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

The guide helps teams avoid common database design pitfalls by teaching principled decisions around normalization, primary keys, timestamps, relationships, and safe foreign-key behavior.

Core Features & Use Cases

  • Guides normalization decisions to minimize redundancy and update anomalies.
  • Provides guidance on PK selection (UUID, auto-increment) and timestamp strategies (created_at, updated_at, deleted_at).
  • Covers relationship types (one-to-one, one-to-many, many-to-many) and ON DELETE semantics, plus indexing recommendations.
  • Use cases include designing schemas for transactional apps, reporting databases, and serverless deployments with Neon, Turso, or PostgreSQL.

Quick Start

Analyze your current schema and apply normalization, PK selection, and FK guidance to improve data integrity and query performance.

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 relational database schema that scales and avoids update anomalies?

To design a relational database schema that scales, apply normalization to minimize data redundancy, choose appropriate primary keys, and configure foreign keys with safe ON DELETE semantics to prevent update anomalies and maintain data integrity.

What is the best way to choose primary keys and timestamp strategies for a new table?

The best way to choose primary keys and timestamp strategies involves evaluating UUID versus auto-increment for uniqueness and indexing performance, while implementing created_at, updated_at, and deleted_at columns to track record lifecycle accurately.

How do I configure foreign keys and indexing for one-to-many and many-to-many relationships?

To configure foreign keys and indexing for relationships, define ON DELETE behaviors to handle cascading removals safely, and apply indexing recommendations on foreign key columns to optimize query performance across one-to-many and many-to-many joins.

Does this database design guidance work for serverless PostgreSQL environments like Neon or Turso?

Yes, this database design guidance works for serverless PostgreSQL environments like Neon and Turso, covering indexing considerations and schema validation specifically tailored to optimize data integrity and performance in serverless deployments.

When should I normalize my database schema versus denormalizing for reporting databases?

You should normalize your database schema to minimize redundancy and update anomalies in transactional applications, whereas denormalizing may be applied strategically for reporting databases to optimize complex read-heavy query performance.