home / skills / jcastillotx / vibe-skeleton-app / mariadb-best-practices

mariadb-best-practices skill

/setup/skills/mariadb-best-practices

This skill helps optimize MariaDB development by applying best-practice rules for queries, security, schema, storage engines, and Galera clusters.

npx playbooks add skill jcastillotx/vibe-skeleton-app --skill mariadb-best-practices

Review the files below or copy the command above to add this skill to your agents.

Files (7)
SKILL.md
1.4 KB
---
name: mariadb-best-practices
description: MariaDB database development standards. Triggers when working with MariaDB databases, Galera cluster, or MariaDB-specific features.
trigger_patterns:
  - mariadb
  - galera
  - aria
  - columnstore
  - system versioning
auto_load_with:
  - mysql-best-practices
---

# MariaDB Best Practices

Comprehensive coding standards for MariaDB database development, optimized for AI agents and LLMs.

## Overview

This skill provides 22 rules organized across 8 categories:

1. **Query Optimization (query-)** - MariaDB optimizer hints, statistics [CRITICAL]
2. **Security (security-)** - Authentication plugins, encryption at rest [CRITICAL]
3. **Schema Design (schema-)** - System versioning, sequences [HIGH]
4. **Storage Engines (engine-)** - InnoDB, Aria, ColumnStore selection [HIGH]
5. **Galera Cluster (galera-)** - Multi-master, SST methods [MEDIUM-HIGH]
6. **Performance Tuning (perf-)** - Thread pool, buffer pool [MEDIUM]
7. **JSON Features (json-)** - JSON functions, dynamic columns [MEDIUM]
8. **Compatibility (compat-)** - MySQL compatibility, migration [LOW-MEDIUM]

## Usage

Reference this skill when:
- Working with MariaDB-specific features
- Setting up Galera cluster
- Using system versioned tables
- Optimizing MariaDB performance
- Migrating from MySQL to MariaDB

## Build

```bash
pnpm build    # Compile rules to AGENTS.md
pnpm validate # Validate rule files
```

Overview

This skill codifies MariaDB database development standards and practical rules for agents working with MariaDB features. It bundles focused guidance across query optimization, security, schema design, storage engines, Galera clustering, performance tuning, JSON handling, and compatibility. The goal is to enforce safe, performant, and maintainable MariaDB usage in applications and deployments.

How this skill works

The skill inspects operation context and suggests rules or fixes tied to MariaDB-specific areas such as optimizer hints, authentication plugins, storage engine selection, and Galera configuration. It flags high-priority concerns (e.g., security and query optimization), recommends configuration and schema changes, and supplies targeted best-practice steps for common tasks like setting up SST for Galera or choosing InnoDB vs Aria. Rules are concise and actionable so agents can apply or recommend changes automatically.

When to use it

  • When designing or reviewing schemas that use MariaDB features like system-versioned tables or sequences
  • When optimizing queries and statistics for MariaDB’s optimizer and hinting system
  • While configuring or operating a Galera multi-master cluster and SST/IST methods
  • When selecting storage engines (InnoDB, Aria, ColumnStore) based on workload
  • During migration from MySQL to MariaDB to handle compatibility differences

Best practices

  • Prioritize secure defaults: enable strong authentication plugins and encryption at rest for sensitive data
  • Optimize queries with updated statistics and use optimizer hints sparingly for stability
  • Design schemas for MariaDB features: use system versioning for audit trails and sequences for lightweight IDs
  • Choose storage engines based on access patterns: InnoDB for general OLTP, Aria for complex temporary work, ColumnStore for analytics
  • Configure Galera with proper SST (rsync/xbstream) choice, quorum awareness, and tuned buffer/connection pools
  • Favor JSON functions and dynamic columns for flexible schemas, but index generated columns where needed for performance

Example use cases

  • Agent reviews a slow query plan and suggests analyzing table statistics and applying a MariaDB optimizer hint
  • Automated deployment script configures Galera SST with xtrabackup-stream and validates cluster health
  • Schema migration tool converts MySQL temporal features to MariaDB system-versioned tables with retention policies
  • Performance audit recommends buffer pool sizing, thread pool tuning, and storage engine changes for workload
  • Security scan enforces TLS, disk encryption, and modern authentication plugins before production rollout

FAQ

Is this skill only for MariaDB GA releases?

The guidance targets MariaDB features broadly; validate exact options against your MariaDB version because some features and defaults can vary by release.

Can I apply these rules to MySQL?

Many principles overlap, but follow this skill only when leveraging MariaDB-specific features or behaviors that differ from MySQL.