PL

planetscale

Manages serverless MySQL databases with Vitess-backed branching and non-blocking schema changes.

Install

mkdir -p .claude/skills/planetscale && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11734" && unzip -o skill.zip -d .claude/skills/planetscale && rm skill.zip

Installs to .claude/skills/planetscale

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

PlanetScale serverless MySQL with branching. Use for scalable MySQL.
68 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • →Manage PlanetScale databases with Git-like branching
  • →Apply non-blocking schema changes
  • →Handle high-traffic MySQL scaling
  • →Use the `pscale` CLI for branch management
  • →Abstract sharding with Vitess
  • →Support standard MySQL drivers

How it works

PlanetScale provides a serverless MySQL platform built on Vitess, enabling Git-like branching for schema management and non-blocking schema changes. It uses standard MySQL drivers for connectivity.

Inputs & outputs

You give it
A `pscale` CLI command, such as `pscale shell my-database main`
You get back
A connection to a PlanetScale database or a database branch operation

When to use planetscale

  • →Create database branch
  • →Apply non-blocking schema migration
  • →Deploy database changes

About this skill

PlanetScale

PlanetScale is a serverless database platform compatible with MySQL. It is built on Vitess, the technology used by YouTube/Slack to scale massively.

When to Use

  • Horizontally Scaled MySQL (Vitess): Scaling relational MySQL applications to millions of queries per second without manual sharding.
  • Non-Blocking Schema Migrations: Executing online DDL schema changes on live multi-terabyte tables with zero downtime and zero locking.
  • Database Branching & Developer Workflows: Branching production databases for local development and merging schema changes via Deploy Requests.
  • Serverless Web Applications: Querying MySQL from serverless environments over HTTP using the PlanetScale serverless driver.

Quick Start

Uses standard MySQL drivers.

# Connect via CLI
pscale shell my-database main

Core Concepts

#Vitess Horizontal Sharding Architecture

VTGate proxies route queries transparently across underlying VTTablet MySQL instances based on a VSchema keyspace:

[ Application Client ] ──→ [ VTGate Stateless Proxy ]
                                    ├── Routes to Shard 1 (-80)
                                    └── Routes to Shard 2 (80-)

#Non-Blocking Online DDL & Deploy Requests

Applies schema changes via an isolated shadow table in the background, syncing changes asynchronously before an atomic cutover:

# 1. Create a development schema branch
pscale branch create my-database add-indexes

# 2. Apply migration on dev branch
pscale shell my-database add-indexes
# SQL: ALTER TABLE orders ADD INDEX idx_status (status);

# 3. Create Deploy Request to merge into production safely
pscale deploy-request create my-database add-indexes

#PlanetScale Serverless Driver over Fetch / HTTP

Executes queries over HTTP/1.1 and HTTP/2 without persistent TCP connections:

import { connect } from "@planetscale/database";

const conn = connect({ url: process.env.DATABASE_URL });
const response = await conn.execute(
  "SELECT id, name FROM users WHERE active = :active",
  { active: 1 },
);
console.log("Users:", response.rows);

Common Patterns

Non-Blocking Deploy Requests for Zero-Downtime Migrations

Problem: Running ALTER TABLE on large production MySQL tables locks reads/writes and causes outages.

Solution: Use PlanetScale deploy requests to test changes on a branch and apply online:

# 1. Create a schema development branch
pscale branch create my-db add-index-branch

# 2. Apply ALTER schema change safely on the branch
pscale shell my-db add-index-branch < schema_update.sql

# 3. Create deploy request to merge into main branch with zero downtime
pscale deploy-request create my-db add-index-branch

Best Practices (2026)

Do:

  • Always Use Deploy Requests for Migrations: Never attempt manual DDL migrations in production; let PlanetScale coordinate non-blocking cutovers.
  • Define a Sharding Key (VSchema) Early: If planning to shard, select a high-cardinality sharding key (e.g. user_id or tenant_id).
  • Use Safe Migrations Mode: Enable Safe Migrations on production branches to block accidental direct DDL executions.
  • Leverage the Serverless Driver: Use @planetscale/database for serverless environments (Vercel, AWS Lambda, Cloudflare).

Don't:

  • Don't use Foreign Key Constraints in Sharded Keyspaces: Vitess does not support distributed foreign key constraints; enforce integrity in application logic.
  • Don't use auto-incrementing integers across sharded tables: Use distributed ID generators (UUIDv7, Snowflake IDs).
  • Don't execute cross-shard joins frequently: Distributed joins across multiple shards incur heavy network latency.

Troubleshooting

ErrorCauseSolution
foreign key constraints are not supported (default)Vitess architecture discourages native foreign keys for horizontal sharding.Enforce referential integrity in application layer or enable foreign key support in settings.
Query exceeds maximum execution timeQuery missing supporting index causing full cluster table scan.Add supporting index via deploy request and review query plan in Insights.
PlanetsScale connection limit exceededServerless application establishing excessive unpooled TCP connections.Use @planetscale/database fetch driver or configure connection pooling.

References

When not to use it

  • →When stored procedures or triggers are required
  • →When application logic is desired within the database

Limitations

  • →Discourages stored procedures/triggers
  • →Recommends using foreign keys carefully in sharded systems
  • →Requires using the Branching workflow for safe migrations

How it compares

This skill offers serverless MySQL with Git-like branching and non-blocking schema changes, simplifying scalable database management compared to traditional MySQL setups.

Compared to similar skills

planetscale side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
planetscale (this skill)07moReviewIntermediate
drizzle-orm323moNo flagsIntermediate
database-design68moReviewIntermediate
prisma-expert128moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry