Add additional read-only regions to your production database.
With the PlanetScale Portals (beta), you can replicate your production database across the globe by creating read-only regions in any PlanetScale region of availability.
This feature supports globally distributed applications by enabling your database to perform low latency reads in the regions closest to your applications and users.
How to create a read-only region
- In the PlanetScale dashboard, select the database you want to add a read-only region to.
- Click on the production branch.
- Click the "Add region" button.
Add read-only region on production branch
- Select the desired region from the dropdown of available regions.
Select read-only region on production branch
- Click "Add region" and wait for your data to finish initially replicating across regions.
- Optionally, connect to your new read-only region by clicking the ellipsis and selecting "Connect". This will return the connection credentials you can use in your application. Each region has its own connection strings and will only work for the region selected.
How to remove a read-only region
- Go to your database's production branch.
- Click on the "..." at the top right of the region that you want to delete.
- Click "Delete region".
Once you delete a region, you will no longer be charged for the storage or row reads associated with that region.
Replication across regions
PlanetScale replicates your data across regions with an asynchronous strategy, first storing your changes in the primary region and then forwarding them to your read-only region(s). The time that it takes those changes to propagate to your read-only region can be defined as "replication lag" and be measured by issuing the following statement to your read-only regions:
max_repl_lag() function will return an instantaneous measurement of the maximum amount of seconds it has been since your read-only region has stored changes made to your primary region.
Connecting to a read-only region will allow you to query your data, but will not allow you to insert, update, or delete it.
Availability and pricing
PlanetScale Portals is only available on our paid Scaler, Team, and Enterprise plans.
Your storage costs will increase linearly with the amount of read-only regions added. For example, if your production branch is 10GB, each region added will increase your total storage cost by 10GB.
Adding new read-only regions will always be billed as standalone storage and will not count toward your included storage.
As an example, let's say you're on our Scaler plan with 10 GB of included storage and your primary contains 5 GB of data. If you have two read-only regions, each one will be charged at our additional storage rate, for a total of 10 GB.
For more information on storage billing costs, see our Billing documentation.
Queries issued to each read-only region will contribute to your total billable row reads per month. Your invoice details will show a new line for rows read from each region.