PlanetScale
02 / 02

Branching, Deploy Requests & Safe Migrations

PlanetScale: Branching, Deploy Requests & Safe Migrations

Database Branching -- Git Workflow for Schema

# Create an isolated branch to test a schema change -- exactly like
# a git feature branch, but for the database schema
pscale branch create mydb add-user-status-column

# Connect to the branch, make the change, test it -- optionally
# against a copy of realistic production data, surfacing issues an
# empty/synthetic test dataset wouldn't reveal at real scale
pscale connect mydb add-user-status-column

# Open a deploy request -- the schema equivalent of a pull request,
# for the team to review exactly what will change before it merges
pscale deploy-request create mydb add-user-status-column

# Review flags potentially risky changes (a type change that could
# truncate data, a change likely to cause a long-running lock)
# BEFORE it's applied to production

# Once approved, merge -- applied via Vitess's online schema change
# mechanism: no table lock for the duration, unlike a traditional
# MySQL ALTER TABLE on a large table
pscale deploy-request deploy mydb <request-number>

Non-Blocking Schema Changes

  • A large table's ALTER TABLE on vanilla MySQL can lock the table for the whole operation -- real application downtime.

  • Vitess's online schema change tooling applies changes via a shadow-table-and-copy approach -- the table stays available for reads/writes throughout.

  • This is a major operational advantage specifically for large, actively-used production tables.

Insights: Query Performance Visibility

  • Built-in visibility into actual query performance -- slow queries, query frequency, patterns.

  • Helps find issues like a missing index without standing up a separate observability stack just for database monitoring.

When PlanetScale Fits

  • Good fit: teams anticipating significant scale, or wanting git-like schema-change safety (isolate, test, review, merge) regardless of scale.

  • Less clear fit: schemas relying heavily on strict foreign-key enforcement, or projects whose actual scale doesn't need sharding-capable architecture -- a simpler single-instance managed database may be a better starting point.

  • CNCF-graduated Vitess underneath reduces single-vendor lock-in risk compared to a fully proprietary, closed database engine.

Keep your own version of these notes — editable, searchable, and organised by your stack.

Start free