database-design
Skill4 starsChanged 9 months agoMITView on GitHub
Use this skill when designing database schemas, choosing between SQL and NoSQL, optimizing queries, designing indexes, modeling relationships, working with vector databases, or planning data migrations. Trigger on keywords: database, schema, SQL, NoSQL, index, query optimization, data model, migration, ORM, PostgreSQL, MongoDB, Redis, vector database, N+1.
65 other projects use a version of this.
Adopted by
Most recently taken up by
- gromov0737/skillstheir own version, first seen Nov 29, 2026
- hybridlabor-api/aostheir own version, first seen Nov 29, 2026
- sivaprasadreddy/sivalabs-agent-skillstheir own version, first seen Nov 29, 2026
- AtilaMedeiros/skillstheir own version, first seen Nov 16, 2026
- Ivan-propio/claude-skillstheir own version, first seen Nov 16, 2026
- rajdeepbhattacharyya25-pixel/agents-for-antigravity-their own version, first seen Nov 15, 2026
Used with
Projects with it also use intelligent-routing, llm-application-dev and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
pepebot-spaceSkillllm-application-dev
Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.
Also in 4 projects that use this
xenitV1Skillred-team-tactics
Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.
Also in 7 projects that use this
MoizIbnYousafSkillaudit-library-health
Use when checking the overall health of a skills library. Run doctor, validate, check for stale skills, and verify generated docs are in sync.
Also in 3 projects that use this
MoizIbnYousafSkillbrowse-and-evaluate
Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.
Also in 3 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
- +5 more from MoizIbnYousaf
Other versions65 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 65
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- MoizIbnYousaf/Ai-Agent-Skills★ 1.1ksame name
- skillcreatorai/Ai-Agent-Skills★ 1.1ksame name
- MoizIbnYousaf/ai-agent-skills★ 1.1ksame name
- KbWen/agentic-os★ 245same name
- sivaprasadreddy/sivalabs-agent-skills★ 198same name
- kid-sid/claude-spellbook★ 190same name
55 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository37 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- ai-agent-designSkill
- ai-assisted-learningSkill
- ai-prompting-patternsSkill
- api-designSkill
- backend-devSkill
- career-growthSkill
- client-communicationSkill
- code-explanationSkill
- code-readingSkill
- code-reviewSkill
- cross-functional-collabSkill
- debugging-mindsetSkill
- devops-cicdSkill
- doc-creationSkill
- focus-productivitySkill
- frontend-designSkill
- git-workflowSkill
- incident-responseSkill
- internal-commsSkill
- interview-prepSkill
- mcp-builderSkill
- performance-reviewSkill
- problem-solvingSkill
- prompt-engineeringSkill
- research-synthesisSkill
- resume-portfolioSkill
- self-healing-mindsetSkill
- side-project-planningSkill
- sprint-planningSkill
- system-designSkill
- technical-communicationSkill
- technical-mentoringSkill
- tech-researchSkill
- testingSkill
- threat-modelingSkill
- web-artifacts-builderSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 61 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Every index slows down writes
- Distinctive: line 70
Use cursor pagination for large tables or infinite scroll.
- Distinctive: line 84
Hybrid: Use SQL as the source of truth, Redis for caching, Elasticsearch for search.
“Common” is measured: kept by at least 6 in 10 of the 61 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Design
Schema Design Principles
- Normalize first — eliminate redundancy, then denormalize only for proven performance needs
- Name clearly —
user_idnotuid,created_atnotts - Every table needs — a primary key,
created_at,updated_at - Soft deletes — add
deleted_atinstead of hard deleting rows you might need to recover
Relationship Patterns
| Relationship | Implementation |
| One-to-One | Foreign key on either table + UNIQUE constraint |
| One-to-Many | Foreign key on the "many" side |
| Many-to-Many | Junction/pivot table with two foreign keys |
Indexing Strategy
Rule: Index columns you filter, sort, or join on frequently.
-- Index for common query patterns
CREATE INDEX idx_orders_user_status ON orders(user_id, status);
CREATE INDEX idx_posts_created ON posts(created_at DESC);
-- Partial index for active records only
CREATE INDEX idx_active_users ON users(email) WHERE deleted_at IS NULL;When NOT to Over-Index
- Every index slows down writes
- Index columns with low cardinality (boolean, status with 3 values) only if queries are very frequent
- Monitor query performance, add indexes based on actual slow queries
Query Optimization
N+1 Query Problem
// BAD — N+1: 1 query for posts + N queries for each author
const posts = await Post.findAll()
for (const post of posts) {
const author = await User.findById(post.userId) // N queries!
}
// GOOD — 2 queries total using JOIN or eager loading
const posts = await Post.findAll({ include: [{ model: User }] })Pagination
-- Offset pagination (simple but slow for large offsets)
SELECT * FROM posts ORDER BY created_at DESC LIMIT 20 OFFSET 100;
-- Cursor pagination (fast for large datasets)
SELECT * FROM posts WHERE created_at < :cursor ORDER BY created_at DESC LIMIT 20;Use cursor pagination for large tables or infinite scroll.
SQL vs NoSQL Cheatsheet
| SQL | NoSQL |
| ACID transactions | High write throughput |
| Complex queries, joins | Flexible/variable schema |
| Data integrity critical | Horizontal scale priority |
| Well-defined schema | Unstructured or nested data |
| PostgreSQL, MySQL | MongoDB, DynamoDB, Cassandra |
Hybrid: Use SQL as the source of truth, Redis for caching, Elasticsearch for search.
Vector Databases (AI Use Cases)
For semantic search, RAG, and embeddings:
| DB | Best For |
| pgvector | Existing PostgreSQL stack |
| Pinecone | Managed, production-scale |
| Weaviate | Multi-modal, hybrid search |
| Chroma | Local dev and prototyping |
Indexing Strategies
- HNSW — best recall, higher memory usage
- IVFFlat — lower memory, slightly lower recall
- Product Quantization — memory-efficient for very large datasets
Migration Best Practices
- Never drop columns in the same deploy as removing code that uses them — separate deploys
- Backward compatible first — add new column → deploy new code → remove old column
- Always test migrations on a copy of production data before running in prod
- Zero-downtime migrations — use
NOT NULL DEFAULTcarefully, add constraints after backfill
Redis Use Cases
| Use Case | Pattern |
| Session storage | Key: session:{id}, TTL |
| Rate limiting | Increment counter with TTL |
| Caching | Key: cache:{resource}:{id}, TTL |
| Pub/Sub | Real-time events between services |
| Job queue | List with LPUSH/BRPOP |
| Leaderboard | Sorted Set (ZADD/ZRANGE) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

