Advanced Using Platform
Boost productivity using this guides, best, practices, working. Includes structured workflows, validation checks, and reusable patterns for database.
Advanced Database Platform
A Claude Code skill for working with databases at an advanced level. Covers multi-database architectures, query optimization across database engines, data modeling patterns, migration strategies, and operational best practices for managing databases in production environments.
When to Use This Skill
Choose Advanced Database Platform when:
- You need to design a multi-database architecture (SQL + NoSQL + Cache)
- You want advanced query optimization across different database engines
- You need to implement database sharding, replication, or partitioning
- You're planning a database migration (engine change or major version upgrade)
- You want production operational guidance (monitoring, backup, disaster recovery)
Consider alternatives when:
- You need PostgreSQL-specific schema design (use a Postgres schema skill)
- You want Supabase-specific optimization (use a Supabase skill)
- You need a specific NoSQL database (use a database-specific skill)
Quick Start
# Install the skill claude install advanced-using-platform # Design a multi-database architecture claude "Design the data layer for an e-commerce platform: product catalog, user sessions, order processing, and analytics" # Optimize cross-database queries claude "My API queries PostgreSQL for user data and Redis for session data. How do I optimize the combined latency?" # Plan a database migration claude "Plan a migration from MongoDB to PostgreSQL for our user service with zero downtime"
Core Concepts
Database Selection Guide
| Workload | Best Fit | Why |
|---|---|---|
| Transactional (OLTP) | PostgreSQL, MySQL | ACID compliance, relational integrity |
| Analytical (OLAP) | ClickHouse, BigQuery | Column-oriented, fast aggregations |
| Caching | Redis, Memcached | In-memory, sub-millisecond access |
| Document Storage | MongoDB, DynamoDB | Flexible schema, horizontal scaling |
| Search | Elasticsearch, Meilisearch | Full-text search, faceted filtering |
| Time Series | TimescaleDB, InfluxDB | Timestamp partitioning, retention policies |
| Graph | Neo4j, DGraph | Relationship-heavy queries |
Multi-Database Patterns
Typical SaaS Architecture:
āāā PostgreSQL (primary store)
ā ā Users, accounts, subscriptions, core business data
ā ā ACID transactions, relational queries
āāā Redis (cache + sessions)
ā ā Session storage, API rate limiting, hot data cache
ā ā Sub-millisecond reads, TTL-based expiry
āāā Elasticsearch (search)
ā ā Full-text search, filtering, autocomplete
ā ā Synced from PostgreSQL via change data capture
āāā S3 (blob storage)
ā Files, images, backups, exports
ā Unlimited storage, lifecycle policies
Query Optimization Fundamentals
| Technique | Applies To | Impact |
|---|---|---|
| Proper Indexing | All SQL databases | 10-1000x speedup |
| Query Planning | PostgreSQL, MySQL | Identify full table scans |
| Connection Pooling | All databases | Prevent connection exhaustion |
| Read Replicas | All databases | Distribute read load |
| Caching Layer | All databases | Eliminate repeated queries |
| Partitioning | Large tables (100M+ rows) | Faster queries on recent data |
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
primary_db | string | "postgresql" | Primary database engine |
scale | string | "medium" | Scale: small (<1M rows), medium (1-100M), large (100M+) |
availability | string | "high" | HA level: standard, high, mission_critical |
environment | string | "cloud" | Environment: local, cloud, hybrid |
monitoring | boolean | true | Include monitoring setup |
Best Practices
-
Start with PostgreSQL, add specialized databases as needed ā PostgreSQL handles 90% of workloads well. Only add Redis, Elasticsearch, or other databases when you have a specific performance need that PostgreSQL can't meet. Every additional database is operational overhead.
-
Use connection pooling everywhere ā Every database connection consumes memory and resources. Use PgBouncer for PostgreSQL, connection pools in your ORM, and client-side pooling for Redis. Connection exhaustion is the number one production database issue.
-
Monitor query performance continuously ā Set up slow query logging with a 100ms threshold. Review the slowest queries weekly. A single unindexed query can bring down a production database under load.
-
Automate backups and test restores ā Automated backups that have never been tested are hope, not a backup strategy. Schedule monthly restore tests to verify backup integrity and practice the restore procedure.
-
Use read replicas for read-heavy workloads ā Most applications are 90% reads. Route read queries to replicas and writes to the primary. This is the simplest way to scale database performance without sharding.
Common Issues
Database connection errors under load ā You're running out of connections. Implement connection pooling, reduce connection timeout values, and ensure connections are released promptly after use. Check for connection leaks in error paths.
Slow queries that were fast before ā Table growth changes query plans. As tables grow from thousands to millions of rows, queries that worked fine start doing full table scans. Run EXPLAIN ANALYZE on slow queries and add indexes for the new data volume.
Data inconsistency between databases ā When using multiple databases, eventual consistency is expected. For critical operations, write to the primary database first and sync to secondary databases asynchronously. Don't rely on multi-database transactions.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.