database-design

Guide database and ORM selection, schema design, indexing, and migrations.

Updated Feb 6, 2026
One-click install
npx skills add https://github.com/Andrejr82/Caculinha_BI --skill database-design-andrejr82
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-design
Source: https://github.com/Andrejr82/Caculinha_BI/tree/main/.agent/skills/database-design
Command: npx skills add https://github.com/Andrejr82/Caculinha_BI --skill database-design-andrejr82

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill guides users through the complex decisions involved in database and ORM selection, schema design, indexing strategies, and query optimization, preventing common anti-patterns and promoting efficient data management.

Core Features & Use Cases

  • Database Selection: Provides decision trees and comparisons for choosing between PostgreSQL, Neon, Turso, SQLite, and others based on project requirements.
  • ORM Selection: Offers guidance on selecting the right ORM (Drizzle, Prisma, Kysely) based on deployment needs and developer experience.
  • Schema Design: Covers normalization, primary key selection, timestamp strategies, and relationship types.
  • Optimization: Details N+1 problem solutions and the use of EXPLAIN ANALYZE.
  • Migrations: Outlines safe migration strategies for zero-downtime deployments.
  • Use Case: A developer needs to choose a database for a new web application. They can use this Skill to evaluate options like PostgreSQL for full features or Turso for edge deployment, and then design an efficient schema with appropriate indexes.

Quick Start

Use the database-design skill to help choose between PostgreSQL and SQLite for a new project.

Frequently Asked Questions about database-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between PostgreSQL and SQLite for a new web application?

To choose between PostgreSQL and SQLite, evaluate your project requirements using decision trees that compare full-feature relational systems against lightweight edge deployments like Turso or Neon. This database selection process ensures you match system capabilities to application scale.

What is the best way to design a database schema with Drizzle or Prisma?

The best way to design a database schema with ORMs like Drizzle or Prisma involves applying normalization, selecting appropriate primary keys, and defining relationship types. Proper schema design prevents common data management anti-patterns and promotes efficient querying.

How do I fix the N+1 query problem in SQL using EXPLAIN ANALYZE?

Fix the N+1 query problem in SQL by utilizing EXPLAIN ANALYZE to identify inefficient data fetching patterns. Query optimization strategies resolve these performance bottlenecks by restructuring data access layers and ensuring proper indexing.

How do I perform zero-downtime database migrations safely?

Perform zero-downtime database migrations safely by following structured migration strategies that prevent table locks and data loss. Safe migration strategies ensure continuous deployment availability while updating your schema without interrupting active users.

Does my database indexing strategy need to change for edge deployments?

Your database indexing strategy should adapt for edge deployments by considering distributed data access patterns. Optimization guidance helps address specific indexing requirements for edge databases like Turso compared to traditional PostgreSQL setups.

When should I use an ORM versus raw SQL for query optimization?

Decide when to use an ORM versus raw SQL for query optimization by comparing developer experience needs against complex query performance requirements. ORM selection guidance evaluates tools like Kysely and Prisma to balance deployment needs with data access efficiency.