With the PlanetScale Portals, you can replicate your production database across the globe by creating read-only regions in any available AWS PlanetScale region.
Portals is not currently supported in GCP regions.
This feature supports globally distributed applications by enabling your database to perform low latency reads in the regions closest to your applications and users.
- 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.
- Select the desired AWS region from the dropdown of available regions.
- 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.
- 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.
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.
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.