Skip to content

Regions

Selecting a region during database and branch creation.

Overview

PlanetScale currently offers database deployment in multiple regions. Select the region closest to your application servers to reduce latency between your database and application. Deploy development branches in the region closest to your own location to reduce latency when working with the branch.

You may also add read-only regions to your production database. See our Read-only regions documentation for more information.

A number of resources exist to help find which region has the lowest latency from your location – such as CloudPing.

Available regions

Currently, the following regions are supported, with their respective PlanetScale slugs:

  • AWS us-east-1 (Northern Virginia) — us-east
  • AWS us-west-2 (Oregon) — us-west
  • AWS eu-west-1 (Dublin) — eu-west
  • AWS ap-south-1 (Mumbai) — ap-south
  • AWS ap-southeast-1 (Singapore) — ap-southeast
  • AWS ap-northeast-1 (Tokyo) — ap-northeast
  • AWS eu-central-1 (Frankfurt) — eu-central
  • AWS ap-southeast-2 (Sydney) — aws-ap-southeast-2
  • AWS sa-east-1 (Sao Paulo) — aws-sa-east-1

Selecting the database region

PlanetScale allows you to select the region for the main branch of your database during database creation. By default, all database branches created within this database will also be created in this region. Select your database region.Select your database region.

Once you select a region for your main branch, it cannot be changed.

You can also select the region while creating a database via the CLI by using the --region flag with the region's slug.

Note

If you do not select a region during database creation using the CLI, it will be set to AWS us-east-1.

Here's an example command for creating a database with a different region:

Copied
pscale database create <DATABASE_NAME> --region us-west

Selecting the branch region

PlanetScale allows you to select a region for development branches during creation as well. By default, it is set to the same region as its database.

Select your branch region.Select your branch region.

Note

Once you select a branch region, it cannot be changed.

You can also select the region while creating a branch via the CLI by using the --region flag with the region's slug.

Here's an example command for creating a branch with a different region:

Copied
pscale branch create my-production-database add-tables --region eu-west

Restricting the branch regions

Organization Administrators can restrict branches to only being created in the same region as the one selected during database creation. To enable this setting, check the Restrict region setting in the settings page for the database: app.planetscale.com/<org>/<database>/settings.

Restrict your branches to one region.Restrict your branches to one region.

Changing branch and database regions

Once you select a region for a production or development branch, it cannot be changed.

If you do need to move to a different region, we recommend taking the following steps:

  1. Create a new branch in the new region.
  2. Backup and dump the original branch with:
Copied
pscale database dump <DATABASE_NAME> <BRANCH_NAME>
  1. Restore the dump to the new branch with:
Copied
pscale database restore-dump <DATABASE_NAME> <BRANCH_NAME>
  1. If this is for a production branch, promote the new branch to production:
Copied
pscale branch promote <DATABASE_NAME> <BRANCH_NAME>
  1. Swap out the credentials in your app with the new branch.

It's important to note that this will require downtime if done on a production branch, as the dump and restore process will take time to complete. To avoid data loss, you can temporarily block writes in your application before doing the dump, and re-enable them after the final credential swap.

Need help?

Get help from the PlanetScale support team, or join our GitHub Discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on August 1, 2022
Help us improve this page
PrivacyTerms© 2022 PlanetScale Inc.