+
-
+ When your database starts slowing down, you face a choice: make your existing database bigger (scale vertically), or spread the load across multiple databases (scale horizontally). Both approaches work. Neither is universally correct. The right answer depends on your workload, your budget, and where the bottleneck actually is.
-Read Replicas are available for all projects on the Pro, Team and Enterprise plans. Spin one up now over at the [Infrastructure Settings page](/dashboard/project/_/settings/infrastructure).
+
-
+
-Projects must meet these requirements to use Read Replicas:
+
-1. Running on AWS.
-1. Running on at least a [Small compute add-on](/docs/guides/platform/compute-add-ons).
- - Read Replicas are started on the same compute instance as the Primary to keep up with changes.
-1. Running on Postgres 15+.
- - For projects running on older versions of Postgres, you will need to [upgrade to the latest platform version](/docs/guides/platform/migrating-and-upgrading-projects#pgupgrade).
-1. Using [physical backups](/docs/guides/platform/backups#point-in-time-recovery)
- - Physical backups are automatically enabled if using [PITR](/docs/guides/platform/backups#point-in-time-recovery)
- - If you're not using PITR, you'll be able to switch to physical backups as part of the Read Replica setup process. Note that physical backups can't be downloaded from the dashboard in the way logical backups can.
-
-## Getting started
-
-To add a Read Replica, go to the [Infrastructure Settings page](/dashboard/project/_/settings/infrastructure) in your dashboard.
-
-You can also manage Read Replicas using the Management API (beta functionality):
-
-```bash
-# Get your access token from https://supabase.com/dashboard/account/tokens
-export SUPABASE_ACCESS_TOKEN="your-access-token"
-export PROJECT_REF="your-project-ref"
-
-# Create a new Read Replica
-curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/read-replicas/setup" \
- -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
- -H "Content-Type: application/json" \
- -d '{
- "region": "us-east-1"
- }'
-
-# Delete a Read Replica
-curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/read-replicas/remove" \
- -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \
- -H "Content-Type: application/json" \
- -d '{
- "database_identifier": "abcdefghijklmnopqrst"
- }'
-```
-
-Projects on an XL compute add-on or larger can create up to five Read Replicas. Projects on compute add-ons smaller than XL can create up to two Read Replicas. All Read Replicas inherit the compute size of their Primary database.
-
-### Deploying a Read Replica
-
-A Read Replica is deployed by using a physical backup as a starting point, and a combination of WAL file archives and direct replication from the Primary database to catch up. Both components may take significant time to complete. The duration of restoring from a physical backup is roughly dependent and directly related to the database size of your project. The time taken to catch up to the primary using WAL archives and direct replication is dependent on the level of activity on the Primary database; a more active database will produce a larger number of WAL files that will need to be processed.
-
-Along with the progress of the deployment, the dashboard displays rough estimates for each component.
-
-{/* supa-mdx-lint-disable-next-line Rule001HeadingCase */}
-
-### What does it mean when "Init failed" is observed?
-
-The status `Init failed` indicates that the Read Replica has failed to deploy. Some possible scenarios as to why a Read Replica may have failed to be deployed:
-
-- Underlying instance failed to come up.
-- Network issue leading to inability to connect to the Primary database.
-- Possible incompatible database settings between the Primary and Read Replica databases.
-- Platform issues.
-
-It is safe to drop this failed Read Replica, and in the event of a transient issue, attempt to spin up another one. If however spinning up Read Replicas for your project consistently fails, do check out our [status page](https://status.supabase.com) for any ongoing incidents, or open a support ticket [here](/dashboard/support/new). To aid the investigation, do not bring down the recently failed Read Replica.
+