Skip to main content

MongoDB Schema Design

Skill Verified Active
Part of:Mongodb

MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree structure", "16MB limit", "schema validation", "JSON Schema", "time series", "schema migration", "polymorphic", "TTL", "data lifecycle", "archive", "index explosion", "unnecessary indexes", "approximation pattern", "document versioning".

Purpose

To help users design efficient, performant, and maintainable MongoDB schemas by understanding and applying proven design patterns and avoiding common anti-patterns.

Features

  • MongoDB schema design patterns
  • Schema anti-patterns and avoidance
  • Embed vs reference decision framework
  • Document and collection sizing guidance
  • Schema validation implementation
  • Data modeling for relationships and hierarchies
  • Data lifecycle management (archiving, versioning)

Use Cases

  • Designing new MongoDB schemas from scratch
  • Migrating SQL schemas to MongoDB
  • Reviewing existing data models for performance issues
  • Troubleshooting slow queries caused by schema problems
  • Deciding on embedding vs referencing strategies
  • Implementing tree structures and complex relationships

Non-Goals

  • Providing specific MongoDB query code beyond examples
  • Automated schema generation or validation execution
  • Database administration tasks unrelated to schema design

Workflow

  1. Understand schema design goals and context.
  2. Consult relevant pattern/anti-pattern references based on identified challenges (e.g., relationships, data size, access patterns).
  3. Apply decision frameworks to choose between embedding, referencing, or other modeling techniques.
  4. Implement schema validation and versioning strategies.
  5. Verify schema design choices using provided diagnostic queries and best practices.

Practices

  • Schema Design
  • Data Modeling
  • Performance Optimization

Prerequisites

  • Basic understanding of MongoDB concepts

Installation

First, add the marketplace

/plugin marketplace add mongodb/agent-skills
/plugin install agent-skills@mongodb-plugins

Quality Score

Verified
99 /100
Analyzed about 18 hours ago

Trust Signals

Last commit3 days ago
Stars111
LicenseApache-2.0
Status
View Source

Similar Extensions

MongoDB Connection Optimizer

100

Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling `connect()`), configuring connection pools, troubleshooting connection errors (ECONNREFUSED, timeouts, pool exhaustion), optimizing performance issues related to connections. This includes scenarios like building serverless functions with MongoDB, creating API endpoints that use MongoDB, optimizing high-traffic MongoDB applications, creating long-running tasks and concurrency, or debugging connection-related failures.

Skill
mongodb

Dsql

100

Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL migration, DDL operations, query plan explainability, and SQL compatibility validation. Triggers on phrases like: DSQL, Aurora DSQL, create DSQL table, DSQL schema, migrate to DSQL, distributed SQL database, serverless PostgreSQL-compatible database, DSQL query plan, DSQL EXPLAIN ANALYZE, why is my DSQL query slow.

Skill
awslabs

Mongodb Search And Ai

100

Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG applications), or combined approaches. Also use when users need text containment, substring matching ('contains', 'includes', 'appears in'), case-insensitive or multi-field text search, or filtering across many fields with variable combinations. Provides workflows for selecting the right search type, creating indexes, constructing queries, and optimizing performance using the MongoDB MCP server.

Skill
mongodb

Sql Optimization

100

Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimization, batch operations, and performance monitoring guidance.

Skill
github

DBHub Database Query Guide

100

Guide for querying databases through DBHub MCP server. Use this skill whenever you need to explore database schemas, inspect tables, or run SQL queries via DBHub's MCP tools (search_objects, execute_sql). Activates on any database query task, schema exploration, data retrieval, or SQL execution through MCP — even if the user just says "check the database" or "find me some data." This skill ensures you follow the correct explore-first workflow instead of guessing table structures.

Skill
bytebase

Supabase Postgres Best Practices

99

Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

Skill
supabase

© 2025 SkillRepo · Find the right skill, skip the noise.