databases

Design and manage MongoDB and PostgreSQL databases with schema modeling, queries, and migrations.

26|9|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/zircote/.claude --skill databases-zircote
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databases
Source: https://github.com/zircote/.claude/tree/main/skills/databases
Command: npx skills add https://github.com/zircote/.claude --skill databases-zircote

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pymongo, psycopg2, and includes scripts (resource) and references (resource) components.

What problem does it solve?

A unified guide to selecting, modeling, querying, indexing, migrating, and administering MongoDB and PostgreSQL.

Core Features & Use Cases

  • Database Selection & Modeling: Choose MongoDB for flexible schemas or PostgreSQL for strict transactions
  • Querying & Aggregation: SQL queries and MongoDB queries/aggregation
  • Indexing & Performance: Optimize indexes, analyze slow queries, and design for scalability
  • Migration, Backups & DR: Schema migrations, backup strategies, disaster recovery
  • Administration & Security: Users, permissions, roles, and data security
  • Scaling & HA: Replication, sharding, clustering, high availability

Quick Start

Design a MongoDB collection and a PostgreSQL table, propose initial indexes, and sketch a migration plan.

Frequently Asked Questions about databases

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

FAQPage Schema
How do I design a MongoDB collection versus a PostgreSQL table for my application?

MongoDB suits flexible, document-based schemas where structure evolves; PostgreSQL enforces strict relational schemas with ACID transactions. Choose MongoDB for semi-structured data and rapid iteration, PostgreSQL for data integrity and complex queries across related tables.

What's the best way to optimize database indexes for query performance?

Index tuning analyzes slow queries to identify missing or redundant indexes. Create indexes on frequently filtered or joined columns, monitor query execution plans, and remove unused indexes. Proper indexing reduces query latency and disk I/O significantly.

How do I migrate data between MongoDB and PostgreSQL databases?

Database migration involves schema design transformation, data mapping, and validation. Plan the schema conversion, extract data from the source, transform it to match the target structure, and load it incrementally. Test migrations in staging before production cutover.

What backup and disaster recovery strategies work for production databases?

Backup strategies include point-in-time recovery, replication, and automated snapshots. PostgreSQL supports WAL archiving and physical backups; MongoDB uses consistent snapshots and oplog replay. Pair backups with tested recovery procedures and off-site storage.

Can I set up replication and sharding across MongoDB and PostgreSQL?

MongoDB natively supports replica sets for high availability and sharding for horizontal scaling. PostgreSQL uses streaming replication for HA and requires external tools or manual partitioning for sharding. Both enable fault tolerance and increased throughput at scale.

How do I manage users, permissions, and security in PostgreSQL and MongoDB?

Database security involves creating roles, assigning granular permissions, and enabling encryption. PostgreSQL uses role-based access control; MongoDB uses RBAC with database and collection-level permissions. Enforce authentication, audit access, and encrypt data in transit and at rest.