mysql-patterns

Apply MySQL and MariaDB schema, query, indexing, and transaction patterns.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill mysql-patterns-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mysql-patterns
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/mysql-patterns
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill mysql-patterns-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Designs and operations of MySQL/MariaDB in production are hampered by suboptimal schemas, poorly performing queries, and fragile migrations. This guide consolidates proven patterns for schemas, indexing, transactions, replication, and connection pools to empower reliable, scalable databases.

Core Features & Use Cases

  • Schema and indexing patterns to optimize read/write paths in MySQL and MariaDB.
  • Transaction patterns and queue-style work to minimize deadlocks and ensure consistency.
  • Replication, connection pools, and diagnostic guidelines for high-traffic deployments.
  • Use cases include designing new tables, reviewing migrations, tuning slow queries, and configuring pools for production apps.

Quick Start

Audit a given schema against the patterns described and propose concrete improvements in a concise, actionable report.

Frequently Asked Questions about mysql-patterns

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

FAQPage Schema
What are the best MySQL indexing patterns for optimizing production read and write paths?

MySQL indexing patterns for production optimize read and write paths by applying composite and covering indexes while eliminating redundant ones. This approach ensures efficient query execution and minimizes write operation overhead.

How do I prevent deadlocks in MySQL and MariaDB transaction patterns?

To prevent deadlocks in MySQL transactions, apply queue-style work patterns and enforce consistent lock ordering across operations. This approach minimizes lock contention and ensures data consistency in high-concurrency environments.

Does this database pattern guide apply to both MySQL and MariaDB production environments?

Yes, these database patterns apply to both MySQL and MariaDB production environments. The guidelines enforce version checks and provide concrete SQL examples that ensure compatibility and safe configuration across both platforms.

How do I configure connection pools for high-traffic MySQL deployments?

Configuring MySQL connection pools for high-traffic deployments involves setting appropriate pool sizes and diagnostic guidelines to manage concurrent connections. This setup prevents connection exhaustion and maintains stable database performance under load.

When should I avoid certain MySQL schema anti-patterns during database migrations?

You should avoid MySQL schema anti-patterns during migrations when they introduce suboptimal structures or fragile execution plans. The guide identifies these anti-patterns to ensure reliable, scalable database designs and safe production migrations.

What is the best way to set up MySQL replication for high-traffic applications?

The best way to set up MySQL replication for high-traffic applications involves applying proven replication patterns and diagnostic guidelines. This configuration ensures reliable data synchronization and scalable read capacity across production deployments.