databases

Design, query, and optimize MongoDB and PostgreSQL databases for scalable schemas.

16|7|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/jackspace/ClaudeSkillz --skill databases-jackspace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databases
Source: https://github.com/jackspace/ClaudeSkillz/tree/main/skills/databases_mrgoonie
Command: npx skills add https://github.com/jackspace/ClaudeSkillz --skill databases-jackspace

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a unified guide to MongoDB (document model) and PostgreSQL (SQL) with practical CRUD examples, indexing strategies, and migration tips.

Core Features & Use Cases

  • MongoDB CRUD, aggregation, indexing
  • PostgreSQL SQL queries, migrations, backups
  • Database selection guidance for different workloads

Quick Start

Run sample Mongo/SQL commands to create a users table/collection and perform basic CRUD.

Frequently Asked Questions about databases

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

FAQPage Schema
How do I choose between MongoDB and PostgreSQL for my application?

MongoDB suits document-based, flexible schemas with horizontal scaling; PostgreSQL excels at relational data with ACID transactions and complex queries. Choose MongoDB for unstructured or rapidly evolving data, PostgreSQL for structured data requiring strict consistency and complex joins.

How do I design efficient indexes in MongoDB and PostgreSQL?

Indexing strategies differ by database: MongoDB uses field-level indexes and compound indexes for aggregation pipelines; PostgreSQL uses B-tree, hash, and specialized indexes for query optimization. Both require analyzing query patterns and avoiding over-indexing to balance read speed against write overhead.

What's the best way to migrate data between MongoDB and PostgreSQL?

Migration involves schema mapping, data transformation, and validation. MongoDB's document structure maps to PostgreSQL tables through denormalization or normalization depending on relational requirements. Use migration tooling to handle BSON serialization, handle type conversions, and verify data integrity post-transfer.

How do I write aggregation pipelines in MongoDB and complex queries in PostgreSQL?

MongoDB aggregation pipelines chain stages ($match, $group, $project) to transform documents; PostgreSQL uses SQL with GROUP BY, joins, and window functions. Both support filtering, grouping, and computed fields; choose based on your data model and query complexity.

Can I use the same backup and replication strategy for both MongoDB and PostgreSQL?

No. MongoDB uses replica sets and Atlas backup; PostgreSQL uses WAL-based replication and pg_dump. Backup frequency, retention, and failover mechanisms differ. Plan database-specific recovery procedures aligned with your RPO and RTO requirements.

What security controls should I implement for MongoDB and PostgreSQL in production?

Both require authentication (SCRAM, certificates), encryption in transit and at rest, role-based access control, and audit logging. MongoDB Atlas and PostgreSQL pgAdmin provide native security features; configure least-privilege roles and monitor for unauthorized access.