vitess

Guides Vitess sharding, VSchema design, query routing, and online schema migrations.

5|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/nuggocto/dotfiles --skill vitess-nuggocto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitess
Source: https://github.com/nuggocto/dotfiles/tree/main/opencode/skills/vitess
Command: npx skills add https://github.com/nuggocto/dotfiles --skill vitess-nuggocto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Scaling MySQL with Vitess introduces sharding, VSchema configuration, cross-shard query behavior, and migration workflows that differ from standard MySQL, and mistakes lead to scatter queries, duplicate IDs, or blocked schema changes. ## Core Features & Use Cases - VSchema and Sharding Design: Choose primary vindexes, co-locate joined tables, configure lookup vindexes, and replace AUTO_INCREMENT with Vitess Sequences. - Query Optimization and Routing: Diagnose scatter queries with VEXPLAIN PLAN, keep transactions single-shard, and apply MySQL compatibility rules for CTEs, subqueries, and foreign keys. - Schema Changes and Data Movement: Run Online DDL with the vitess strategy, monitor migrations via SHOW VITESS_MIGRATIONS, and execute MoveTables, Reshard, Materialize, and VDiff workflows. - Use Case: A query on orders is slow because it lacks the customer_id vindex filter; use this Skill to identify the scatter routing, add the vindex predicate, and verify single-shard routing with VEXPLAIN PLAN. ## Quick Start Ask the assistant to review your Vitess query or VSchema configuration and explain how to route it to a single shard.

Frequently Asked Questions about vitess

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

FAQPage Schema
How do I avoid scatter queries in Vitess?

Include the primary vindex column in your WHERE clause with an equality filter so VTGate routes to a single shard. Verify routing with VEXPLAIN PLAN and look for an EqualUnique route variant instead of Scatter.

How do I run schema changes in Vitess without downtime?

Use Online DDL with the vitess ddl strategy, which is VReplication-based, non-blocking, and revertible. Monitor progress with SHOW VITESS_MIGRATIONS and control migrations with ALTER VITESS_MIGRATION commands.

Does Vitess support AUTO_INCREMENT on sharded tables?

MySQL AUTO_INCREMENT is per-shard and produces duplicate values on sharded tables. Use Vitess Sequences, a single-row counter table in an unsharded keyspace, linked to the sharded table via the auto_increment VSchema property.

What MySQL features are not supported by Vitess?

Vitess does not support stored procedures, triggers, events, LOCK TABLES, or CREATE/DROP DATABASE through VTGate. Cross-shard SELECT FOR UPDATE is not atomic, and foreign keys have limited support on sharded keyspaces.

How do I move tables between Vitess keyspaces?

Use the MoveTables VReplication workflow with vtctldclient: create the workflow, run VDiff to verify consistency, switch traffic (reads first, then writes), and complete. Reverse replication stays enabled by default for rollback.