agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/databases/mariadb/SKILL.md

mariadb

Skill15 starsChanged 46 days agoMITView on GitHub

Expert MariaDB relational database assistance covering Galera Cluster, ColumnStore, Aria storage engine, and SQL replication. Use when running high-availability MySQL-compatible relational databases.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use InnoDB as Default Storage Engine: Reserve Aria storage for temporary tables and ColumnStore for analytical queries.

    line 101
  2. Distinctive:

    Use legacy MyISAM tables: MyISAM lacks crash safety and row-level locking.

    line 107
  3. Distinctive:

    Treat Galera Cluster as a multi-region WAN database: High cross-region latency degrades synchronous write throughput.

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MariaDB

MariaDB is a fork of MySQL, created by the original developers of MySQL. It is guaranteed to stay open source. It lists features that MySQL doesn't have, or adds them faster.

When to Use

  • High-Performance MySQL Drop-in Replacement: Upgrading MySQL infrastructure with enhanced performance, Aria storage, and thread pooling.
  • Temporal Data & System-Versioned Tables: Retaining automatic audit histories of all row modifications using SQL:2011 system versioning.
  • ColumnStore Analytical Processing: Running hybrid transactional and analytical processing (HTAP) in a single database server.
  • Enterprise Open-Source Relational SQL: Deploying mission-critical relational databases with enterprise-grade replication (Galera Cluster).

Quick Start

Same as MySQL usually.

-- System-Versioned Tables (Time Travel)
CREATE TABLE t (
  x INT,
  PERIOD FOR SYSTEM_TIME (ts_start, ts_end)
) WITH SYSTEM VERSIONING;

-- Query history
SELECT * FROM t FOR SYSTEM_TIME AS OF TIMESTAMP '2024-01-01 00:00:00';

Core Concepts

System-Versioned Tables (Automatic Audit Trails)

Tracks complete historical lifecycles of rows automatically without application triggers:

CREATE TABLE employees (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100),
    department VARCHAR(50),
    salary DECIMAL(10,2)
) WITH SYSTEM VERSIONING;

-- Query historical state as of yesterday
SELECT * FROM employees
FOR SYSTEM_TIME AS OF (NOW() - INTERVAL 1 DAY)
WHERE department = 'Engineering';

Galera Cluster Synchronous Multi-Master Replication

Enforces synchronous multi-node replication with zero replication lag and automated node joining:

[ Node 1 (Primary) ] ──Synchronous Write Certification (wsrep)──→ [ Node 2 (Primary) ]
                                      │
                                      ▼
                             [ Node 3 (Primary) ]

Modern Thread Pooling for High Concurrency

Maintains stable throughput during connection spikes using server-side thread pools:

# /etc/mysql/mariadb.conf.d/50-server.cnf
[mariadb]
thread_handling=pool-of-threads
thread_pool_size=16
thread_pool_max_threads=1000

Common Patterns

Galera Multi-Master High Availability Configuration

Problem: Master-slave failover delays cause downtime and split-brain risks during network disruptions.

Solution: Configure synchronous multi-master replication in server.cnf:

[galera]
wsrep_on=ON
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="galera_cluster"
wsrep_cluster_address="gcomm://10.0.0.1,10.0.0.2,10.0.0.3"
wsrep_node_name="node1"
wsrep_node_address="10.0.0.1"
binlog_format=ROW
default_storage_engine=InnoDB

Best Practices

Do:

  • Leverage System-Versioned Tables for Compliance: Use native versioning rather than complex manual audit trigger scripts.
  • Use InnoDB as Default Storage Engine: Reserve Aria storage for temporary tables and ColumnStore for analytical queries.
  • Enable the Thread Pool Plugin: Handle thousands of concurrent web connections without thread creation overhead.
  • Configure Automated Galera Cluster Quorum: Deploy odd numbers of nodes (minimum 3) to prevent split-brain conditions.

Don't:

  • Use legacy MyISAM tables: MyISAM lacks crash safety and row-level locking.
  • Treat Galera Cluster as a multi-region WAN database: High cross-region latency degrades synchronous write throughput.
  • Skip slow query logging: Enable slow_query_log and long_query_time = 1.0 to identify missing indexes.

Troubleshooting

ErrorCauseSolution
Deadlock found when trying to get lock (Galera certification)Concurrent writes to same row across different Galera cluster nodes.Route write traffic to a single primary node and use read replicas.
WSREP has not yet prepared node for application useNode currently in State Snapshot Transfer (SST) synchronization.Wait for joiner node to finish syncing or check wsrep_local_state_comment.
Table is marked as crashed and should be repairedImproper shutdown or disk corruption on Aria/MyISAM tables.Run REPAIR TABLE tablename; or migrate to InnoDB storage engine.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.