databases

Design and optimize MongoDB and PostgreSQL schemas, queries, and migrations.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/nguyenvanlinh1902/trackingSolar --skill databases-nguyenvanlinh1902
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: databases
Source: https://github.com/nguyenvanlinh1902/trackingSolar/tree/main/.opencode/skill/databases
Command: npx skills add https://github.com/nguyenvanlinh1902/trackingSolar --skill databases-nguyenvanlinh1902

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Designing data models that work well in both MongoDB (document-oriented) and PostgreSQL (relational) can be complex, and teams often struggle to decide when to normalize, denormalize, or denormalize across systems while keeping queries consistent.

Core Features & Use Cases

  • Unified guidance for database schema design, SQL/NoSQL queries, aggregation pipelines, and indexing across MongoDB and PostgreSQL.
  • Practical patterns for migrations, replication, backups, and performance optimization aligned with OLTP and OLAP needs.
  • Side-by-side decision framework to compare when to use document vs relational models for typical features like users, orders, and analytics.

Quick Start

Create a starter schema for a small e-commerce app that demonstrates both a MongoDB collection design and a PostgreSQL relational schema.

Frequently Asked Questions about databases

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

FAQPage Schema
How do I design database schemas for both PostgreSQL and MongoDB?

Database schema design for PostgreSQL and MongoDB requires a side-by-side decision framework to compare relational and document models. You can apply modular patterns to normalize or denormalize data while keeping queries consistent across both systems.

When should I use a document model vs a relational model for my application?

A document model suits flexible, hierarchical data like product catalogs, while a relational model fits structured transactional data like orders. Comparing typical features helps decide when to normalize or denormalize across PostgreSQL and MongoDB.

What's the best way to optimize indexing strategies across SQL and NoSQL databases?

Optimizing indexing strategies across SQL and NoSQL databases involves applying targeted patterns for both PostgreSQL and MongoDB. You can structure indexes to support aggregation pipelines and relational queries for improved OLTP and OLAP performance.

How do I handle database migrations and backups for cross-database workflows?

Handling database migrations and backups for cross-database workflows uses practical tooling patterns for replication and data transfer. This ensures consistent schema updates and reliable data recovery across MongoDB and PostgreSQL environments.

Can I use a unified approach for data modeling in real-world apps with mixed database systems?

A unified approach for data modeling in real-world apps supports mixed database systems by providing cross-database workflows. It applies modular schema design to maintain query consistency and performance across MongoDB and PostgreSQL deployments.

Why does my query performance drop when joining denormalized data across PostgreSQL and MongoDB?

Query performance drops when joining denormalized data across PostgreSQL and MongoDB due to mismatched indexing or schema design choices. Aligning indexing strategies and normalization levels with your specific OLTP or OLAP needs resolves these bottlenecks.