Agent skill
database-design-patterns
Quellcode ansehen: nickcrew/claude-cortex
Installation
npx skills add nickcrew/claude-cortex --skill database-design-patterns63
Installationen
EU-hosted inference API
Power your AI agent skills with open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
MiniMax
MiniMax M3
$0.50 / $1.90
per M tokens
Z.ai
GLM 5.3 Flash
$0.20 / $0.60
per M tokens
MoonshotAI
Kimi K3
$4.00 / $18.00
per M tokens
DeepSeek
DeepSeek V4.1 Flash
$0.40 / $1.42
per M tokens
Database Design Patterns
Expert guidance for designing scalable database schemas, optimizing query performance, and implementing robust data persistence layers across relational and NoSQL databases.
When to Use This Skill
- Designing database schemas for new applications
- Optimizing slow queries and database performance
- Choosing between normalization and denormalization strategies
- Implementing partitioning, sharding, or replication strategies
- Migrating between database technologies (SQL to NoSQL or vice versa)
- Designing for high availability and disaster recovery
- Implementing caching strategies and read replicas
- Scaling databases horizontally or vertically
- Ensuring data consistency in distributed systems
Core Concepts
Data Modeling
Design schemas that reflect business domain, access patterns, and consistency requirements. Balance normalization (data integrity) with denormalization (read performance) based on workload characteristics.
ACID vs. BASE
- ACID (Relational): Atomicity, Consistency, Isolation, Durability - strong guarantees
- BASE (NoSQL): Basically Available, Soft state, Eventually consistent - flexibility
CAP Theorem
Distributed systems choose two of three: Consistency, Availability, Partition Tolerance.
Polyglot Persistence
Use the right database for each use case: PostgreSQL for transactions, MongoDB for documents, Redis for caching, Elasticsearch for search, Cassandra for time-series, Neo4j for graphs.
Quick Reference
| Task | Load reference |
|---|---|
| Core database principles (ACID, BASE, CAP) | skills/database-design-patterns/references/core-principles.md |
| Schema patterns (normalization, star schema, documents) | skills/database-design-patterns/references/schema-design-patterns.md |
| Index types and strategies (B-tree, hash, covering) | skills/database-design-patterns/references/indexing-strategies.md |
| Partitioning and sharding approaches | skills/database-design-patterns/references/partitioning-patterns.md |
| Replication modes (primary-replica, multi-leader) | skills/database-design-patterns/references/replication-patterns.md |
| Query optimization and caching | skills/database-design-patterns/references/query-optimization.md |
Workflow
Phase 1: Requirements Analysis
- Identify access patterns (read-heavy vs. write-heavy)
- Determine consistency requirements (strong vs. eventual)
- Estimate data volume and growth rate
- Define SLA requirements (latency, availability)
Phase 2: Schema Design
- Model entities and relationships
- Choose normalization level based on workload
- Design for query patterns, not just storage
- Consider data distribution strategy (partitioning/sharding)
Phase 3: Performance Optimization
- Analyze query execution plans (
EXPLAIN ANALYZE) - Add indexes for frequent queries
- Implement caching where appropriate
- Configure connection pooling
- Monitor and iterate
Phase 4: Scaling Strategy
- Implement read replicas for read scaling
- Consider partitioning for large tables (>100M rows)
- Plan sharding strategy for horizontal scaling
- Design for high availability with replication
Common Mistakes
Over-normalization: Too many joins slow down reads. Denormalize for read-heavy workloads.
Missing indexes: Analyze query patterns and add indexes for frequent WHERE/JOIN columns.
Wrong index type: Use composite indexes with correct column order (equality first, then range).
Ignoring replication lag: Handle eventual consistency with read-your-writes pattern.
Poor partitioning key: Choose keys that distribute data evenly and align with query patterns.
N+1 queries: Use JOINs or batch loading instead of querying in loops.
Inefficient pagination: Use keyset pagination instead of OFFSET for large datasets.
Connection exhaustion: Implement connection pooling sized for your workload.
Best Practices
- Model for access patterns - Design schemas around how data will be queried
- Index strategically - Index frequently queried columns, avoid over-indexing
- Partition large tables - Use for tables >100M rows or time-series data
- Replicate for reads - Primary-replica for read scaling, multi-leader for geo-distribution
- Optimize queries - Analyze execution plans, avoid N+1, use proper pagination
- Cache hot data - Application-level caching with appropriate TTLs
- Pool connections - Size connection pools based on workload
- Monitor continuously - Track query performance, index usage, replication lag
- Plan for growth - Design for 3x current load
- Choose consistency wisely - Match consistency level to business requirements
Resources
Books:
- "Designing Data-Intensive Applications" (Kleppmann)
- "High Performance MySQL" (Schwartz)
Sites:
- use-the-index-luke.com
- PostgreSQL documentation
- MongoDB documentation
Tools:
- EXPLAIN ANALYZE
- pg_stat_statements
- Percona Toolkit
- pt-query-digest
Verwandte Skills
Mehr aus dieser Quelle: nickcrew/claude-cortex
react-performance-optimization
nickcrew/claude-cortex
1.9K installs
owasp-top-10
nickcrew/claude-cortex
760 installs
ui-design-aesthetics
nickcrew/claude-cortex
362 installs
threat-modeling-techniques
nickcrew/claude-cortex
357 installs
token-efficiency
nickcrew/claude-cortex
245 installs
repo-cleanup
nickcrew/claude-cortex
183 installs
So verwenden Sie diesen Skill
- 1
Install database-design-patterns by running
npx skills add nickcrew/claude-cortex --skill database-design-patternsin your project directory. Führen Sie den obigen Installationsbefehl in Ihrem Projektverzeichnis aus. Die Skill-Datei wird von GitHub heruntergeladen und in Ihrem Projekt platziert. - 2
Keine Konfiguration erforderlich. Ihr KI-Agent (Claude Code, Cursor, Windsurf usw.) erkennt installierte Skills automatisch und nutzt sie als Kontext bei der Code-Generierung.
- 3
Der Skill verbessert das Verständnis Ihres Agenten für database-design-patterns, und hilft ihm, etablierte Muster zu befolgen, häufige Fehler zu vermeiden und produktionsreifen Code zu erzeugen.
Was Sie erhalten
Skills sind Klartext-Anweisungsdateien — kein ausführbarer Code. Sie kodieren Expertenwissen über Frameworks, Sprachen oder Tools, das Ihr KI-Agent liest, um seine Ausgabe zu verbessern. Das bedeutet null Laufzeit-Overhead, keine Abhängigkeitskonflikte und volle Transparenz: Sie können jede Anweisung vor der Installation lesen und prüfen.
Kompatibilität
Dieser Skill funktioniert mit jedem KI-Coding-Agenten, der das skills.sh-Format unterstützt, einschließlich Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider und anderen Tools, die projektbezogene Kontextdateien lesen. Skills sind auf Transportebene framework-agnostisch — der Inhalt bestimmt, für welche Sprache oder welches Framework er gilt.
Data sourced from the skills.sh registry and GitHub. Install counts and security audits are updated regularly.