moai-domain-database

Design schemas, optimize queries, and configure PostgreSQL, MongoDB, Redis, Oracle, and cloud databases.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-domain-database-jjjh7401
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: moai-domain-database
Source: https://github.com/jjjh7401/AI-Lighting_Console/tree/main/.moai/archive/skills/v2.16/moai-domain-database
Command: npx skills add https://github.com/jjjh7401/AI-Lighting_Console --skill moai-domain-database-jjjh7401

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing the right database, designing schemas, and tuning queries across relational, document, in-memory, and cloud platforms requires deep, scattered expertise. This Skill consolidates patterns for PostgreSQL, MongoDB, Redis, Oracle, and cloud databases (Neon, Supabase, Firestore) into one reference so you can make correct design and optimization decisions without guesswork. ## Core Features & Use Cases - Schema Design & Data Modeling: Relational constraints, document modeling, partitioning, and indexing strategies for PostgreSQL, MongoDB, and Oracle. - Query & Performance Optimization: EXPLAIN ANALYZE workflows, aggregation pipeline tuning, caching layers, and connection pool configuration. - Cloud Database Selection: Decision guide for Neon (serverless PostgreSQL with branching), Supabase (pgvector, RLS, real-time), and Firebase Firestore (offline sync, Security Rules). - Use Case: You are building a multi-tenant SaaS app and need to pick between Supabase RLS and Firestore Security Rules, then design the schema and indexes. This Skill provides the decision table, policy patterns, and migration checklists. ## Quick Start Ask the AI to design a PostgreSQL schema with indexes and a reversible migration for your application's data model.

Frequently Asked Questions about moai-domain-database

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

FAQPage Schema
How do I optimize a slow PostgreSQL query?▼

Run EXPLAIN ANALYZE BUFFERS on the query to inspect the actual execution plan, then check that indexes exist for columns used in WHERE, JOIN, and ORDER BY clauses. Add or adjust indexes based on the plan and re-measure on representative data volumes.

Neon vs Supabase vs Firestore: which cloud database should I choose?▼

Choose Neon for serverless PostgreSQL with auto-scaling and database branching for CI/CD previews. Choose Supabase for pgvector search, Row-Level Security, and real-time subscriptions. Choose Firebase Firestore for mobile-first apps needing offline sync and cross-platform SDKs.

Does MongoDB need schema design if it is schemaless?▼

Yes. Schemaless does not mean designless; document structure decisions affect every query and index. Model documents around access patterns, define validation rules, and plan indexes for aggregation pipelines before writing data.

How do I set up Row-Level Security in Supabase?▼

Create a policy on the table using auth.uid(), for example: CREATE POLICY "users_own_data" ON items FOR ALL USING (auth.uid() = user_id). This restricts each user to their own rows for multi-tenant applications.

Why should every schema change have a migration file?▼

Schema changes without migrations are unreproducible across environments. Every change needs a reversible migration script (via Alembic, Flyway, or Prisma) so deployments can be applied and rolled back consistently.

When should I use Redis alongside PostgreSQL or MongoDB?▼

Use Redis as a caching layer for hot data, real-time counters, distributed locks, and pub/sub messaging while keeping PostgreSQL or MongoDB as the system of record. Configure explicit TTLs and cache invalidation on writes to avoid stale reads.