PlanetScale
PlanetScale is a managed MySQL-compatible database platform built on Vitess, the system that scaled MySQL at YouTube. It pairs MySQL compatibility with modern developer workflows: database branching for safe, isolated changes and non-blocking online schema migrations that deploy without locking your tables.
Think "MySQL plus a Git-like workflow." You branch the schema, make changes, open a deploy request, and merge — reviewed and reversible, the way you'd ship code.
TL;DR
- Managed MySQL on Vitess — horizontal scale with familiar SQL.
- Branch the schema for previews and feature work, like Git.
- Online schema changes apply without long table locks.
- Treat schema changes as reviewed code; use connection pooling from serverless.
Quick Example
A pooled, parameterized query — the everyday way to talk to PlanetScale from Node:
Core Concepts
- MySQL-compatible — connect with standard MySQL drivers and SQL.
- Vitess — the underlying engine enabling horizontal sharding and scale.
- Branches — a
mainbranch is production; feature/dev branches isolate schema changes. - Deploy requests — review and apply schema changes online, without blocking writes.
Branching Workflow
This is especially valuable when your pipeline spins up a preview environment per pull request.
Schema Changes
PlanetScale's online migrations reduce downtime, but discipline still matters:
- Prefer expand/contract migrations for production (add, dual-write, backfill, then contract).
- Avoid large, risky rewrites in a single migration.
- Treat migrations as production code — reviewed, tested, observable.
Best Practices
- Review schema changes through deploy requests like code reviews.
- Pool connections and keep them short-lived in serverless runtimes.
- Index for your high-traffic query patterns; watch for table scans.
- Keep production and preview branches clearly separated, with a cleanup policy.
Common Mistakes
Assuming every MySQL feature behaves identically
Branch sprawl without a policy
FAQ
What is PlanetScale built on?
Vitess — the open-source database clustering system created to scale MySQL at YouTube. It gives PlanetScale horizontal scalability and operational tooling while keeping MySQL wire compatibility, so your existing MySQL drivers and SQL work.
How does database branching work?
You branch the schema like a Git branch: production lives on main, and you create isolated branches for changes. After testing, you open a deploy request that applies the schema change to production online — reviewed, and without locking tables.
What are non-blocking online schema changes?
Schema migrations that apply without holding long locks that would block reads/writes. PlanetScale runs them in the background and cuts over safely, which is why large ALTERs don't take production down — though you should still design migrations to be backward-compatible.
PlanetScale or Neon?
PlanetScale for MySQL compatibility with Vitess-backed scale and branching; Neon for serverless Postgres with branching. Both offer Git-like database workflows — pick by whether your stack wants MySQL or Postgres.
Related Topics
- MySQL — The compatible engine
- Neon — Branching for Postgres
- Database Migrations — Expand/contract patterns
- Databases — Choosing a data store
- Serverless Patterns — Connection management