Home Knowledge Base PlanetScale

PlanetScale is a serverless MySQL database platform built on Vitess with Git-like branching and non-blocking schema migrations, enabling zero-downtime deployments and horizontal scaling without traditional database operational complexity.

What Is PlanetScale?

Why PlanetScale Matters

Key Features

Non-Blocking Schema Changes:

Database Branching:

Horizontal Sharding:

Connection Pooling:

Insights Dashboard:

Quick Start

# Install CLI
brew install planetscale/tap/pscale

# Authenticate
pscale auth login

# Create database
pscale database create mydb

# Create development branch
pscale branch create mydb dev-auth

# Connect to branch
pscale connect mydb dev-auth

# Make schema changes
# In another terminal: pscale shell mydb dev-auth
# ALTER TABLE users ADD COLUMN email VARCHAR(255);

# Create deploy request (like PR)
pscale deploy-request create mydb dev-auth

# Deploy to production (zero downtime!)
pscale deploy-request deploy mydb 1

Non-Blocking Migration Example

-- On development branch
ALTER TABLE users ADD COLUMN email VARCHAR(255) NOT NULL DEFAULT '';

-- This triggers:
-- 1. Create shadow table
-- 2. Copy data in background
-- 3. Rename process
-- 4. Drop old table
-- -- All without locking!

-- Deploy request shows this operation is safe
-- Deploy to production -> zero downtime

Branching Workflow for Schema Changes

Scenario: Adding Email Column to Users Table

# 1. Create branch
pscale branch create mydb add-email

# 2. Make changes
pscale shell mydb add-email
> ALTER TABLE users ADD COLUMN email VARCHAR(255);

# 3. Test changes (connect app to branch)
pscale connect mydb add-email

# 4. Create deploy request
pscale deploy-request create mydb add-email

# 5. Review schema diff
# (PlanetScale shows exact changes)

# 6. Deploy to production (zero downtime!)
pscale deploy-request deploy mydb 1

# 7. Cleanup
pscale branch delete mydb add-email

Code Example

// Node.js with Prisma
import { PrismaClient } from "@prisma/client";

const prisma = new PrismaClient();

// Regular queries work same as MySQL
const users = await prisma.user.findMany({
  where: { active: true }
});

// Create with transaction
await prisma.$transaction([
  prisma.order.create({ data: order }),
  prisma.inventory.update({
    where: { id: item.id },
    data: { quantity: { decrement: 1 } }
  })
]);

Use Cases

High-Growth Startups:

E-commerce Platforms:

SaaS Applications:

Team Collaboration:

Data-Heavy Applications:

Pricing Model

Hobby Plan (Free):

Scaler Plan ($29/month):

Team Plan ($299/month):

Enterprise (Custom):

Integration Ecosystem

ORMs & Tools:

Platforms:

Tools:

Performance Benchmarks

PlanetScale vs Alternatives

FeaturePlanetScaleNeonRDS AuroraTraditional MySQL
MySQL
Branching
Zero-Downtime Deploy
Auto-Sharding
Serverless

Best Practices

1. Use branches: One per feature, test before production 2. Monitor queries: Use Insights to find slow queries 3. Add indexes: Follow recommendations in dashboard 4. Safe migrations: Test on branch before production 5. Connection pooling: Use built-in PlanetScale proxy 6. Choose shard key: Critical for performance 7. Backup strategy: Enable automated backups 8. Team permissions: Control who can deploy

Common Patterns

Add New Column:

Index Addition:

Data Migration:

PlanetScale brings GitHub-like workflows to databases, eliminating schema change anxiety and enabling continuous deployment of database changes alongside application code.

planetscalemysqlserverless

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.