
PlanetScale branching
The PlanetScale branching feature allows you to treat your databases like code by creating a branch of your production database schema to serve as an isolated development environment. PlanetScale provides two types of database branches: development and production. Development branches provide isolated copies of your database schema where you can make changes, experiment, or run CI against. Instantly branch your production database to create a staging environment for testing out your schema changes. Production branches are highly available databases intended for production traffic. They include an additional replica for high availability and are automatically backed up daily. Branches can also have safe migrations enabled for zero-downtime schema migrations, protection against accidental schema changes, and enhanced team collaboration through deploy requests. We also offer a Data Branching® feature, which allows you to create an isolated replica of your database for development that includes both the schema and data. Learn more about database branching.Non-blocking schema changes
PlanetScale makes it safe to deploy schema changes to production and easy to automate schema management as a part of your CI/CD process. Schema changes to production branches with safe migrations enabled are applied online and protect against changes that block databases, lock individual tables, or slow down production during the migration. Use a development branch to apply schema changes and view the schema diff in the UI or the CLI. Once you’re satisfied with your schema changes, you can open a deploy request. Learn more about non-blocking schema changes.Deploy requests
NoteYour database must have a branch with safe migrations enabled before you can create a deploy request.
CREATE
, ALTER
, and DROP
) for each table changed, with a line-by-line schema diff, making it easy to review the changes.
For example, you can pair deploy requests with GitHub pull requests so that your teammates can review the code and the schema changes in parallel.
PlanetScale also analyzes your schema changes for conflicts when you open a deploy request. It checks against the production schema at the time the branch was created and against the current production schema which may have changed in the interim. This ensures your changes can be deployed safely without impacting production.