Database Replicas
Replicas copy data from the primary database and can serve read traffic. Manage them from your database's Nodes tab and copy connection details from Connectivity.
Replica scaling is available for operator-managed PostgreSQL, MySQL, and MariaDB databases. Older databases using the legacy deployment do not support adding replicas.
Creating a Replica
- Open your database and select Nodes.
- Click Add replicas.
- Enter How many to add. You can request 1–10 at a time, subject to your account limits and available capacity.
- Review the resulting replica count and estimated additional cost, then confirm the addition.
- Watch the Nodes tab while the new replicas start and synchronize. Use Refresh to update their status.
Each replica runs on the same plan as the primary. You choose the count, not a separate name, host, or resource profile for each replica. The drawer shows the hourly price and estimated monthly cost; billing starts when the replica is ready.
A new replica first copies the database, then follows changes from the primary. Larger databases take longer to synchronize. Wait until it is ready before relying on it for reads.
Connecting to Replicas
Use the endpoints shown on Connectivity. Replicas do not receive individual public hostnames; do not construct addresses from their node names.
Reader Endpoint
The reader endpoint becomes available when the database has replicas. Connections are distributed across replicas, rather than sent to the primary. It is an internal cluster address ending in .svc.cluster.local, not a public endpoint.
The service name depends on the database deployment:
| Database | Internal reader service |
|---|---|
| PostgreSQL (CloudNativePG) | <database-name>-ro |
| MySQL operator | mysql-<database-name>-ro |
| MariaDB operator | mariadb-<database-name>-secondary |
These are service-name patterns, not complete connection strings. Copy the full hostname and port from Connectivity, and use the database's credentials and TLS settings. An external machine cannot resolve or reach an internal cluster address directly.
For MySQL, the reader endpoint serves the asynchronous read replicas. The standby servers in a high-availability group are separate from these readers.
PostgreSQL Connection Proxy
When the PostgreSQL connection proxy is enabled, its endpoints have different purposes:
| Endpoint | Destination | Use |
|---|---|---|
Primary proxy (-proxy-rw) | Primary | Writes and reads that need the primary |
Reader proxy (-proxy-ro) | Replicas only | Reads that can tolerate replication lag; requires replicas |
Any-node proxy (-proxy-r) | Primary or a replica | Reads that can run on either |
The any-node endpoint is not a writable endpoint and is not an exclusive replica pool. A connection may reach a read-only standby, where writes fail. With no replicas it reaches the primary. Keep writes on the primary endpoint even if a write through the any-node endpoint happens to succeed.
The reader proxy remains internal. The primary and any-node proxies can have public addresses when public proxy access is enabled; use the exact address and port displayed in Connectivity. Enabling public access to the primary does not give the internal reader endpoint a public address.
See PostgreSQL connection pooling for proxy configuration.
Application Connections
Keep separate connection settings for writes and replica reads:
- Send writes, schema changes, and reads that must immediately reflect a write to the primary.
- Send reporting and other lag-tolerant reads to the reader endpoint, or to the PostgreSQL any-node proxy when either primary or replica is acceptable.
- Configure your application or database client to select the appropriate connection. The platform does not inspect SQL and split reads from writes for you.
- Allow connections to reconnect after topology changes. Existing sessions are not moved to another server automatically.
Do not use a fixed sleep after a write as proof that a replica has caught up.
Replication Consistency
A replica can lag behind the primary. A ready server is not a guarantee that every recent write is already visible there, and synchronization behavior differs between providers and configurations. In particular, MySQL read replicas replicate asynchronously.
For read-after-write consistency, use the primary connection. Check the node's replication status and available lag information in Nodes before moving more read traffic to replicas. Missing lag information should not be treated as zero lag.
Failover and High Availability
Read capacity and high availability are related but differ by provider:
- PostgreSQL: replicas can take over if the primary fails. Applications must reconnect after failover; active transactions can fail.
- MySQL: read replicas serve reads and do not take over writes. High availability uses a separate group with two standby servers, controlled by Turn on high availability in Nodes.
- MariaDB: replicas participate in the operator-managed replication topology. Removing the last replica leaves no standby to take over.
Adding replicas is not a promise of uninterrupted connections or zero data loss. Replicas also do not replace backups: unwanted changes can replicate along with valid writes. Keep database backups configured for recovery.
Replica Management
Scaling Replicas
Use Add replicas in Nodes to increase the count. Replicas share the primary's resource specification; there is no independent replica sizing control. To change the plan, resize the database instance rather than trying to select a smaller or larger replica profile.
Removing Replicas
- Open a removable replica in Nodes.
- Choose Remove a replica.
- Review the confirmation and confirm the lower count.
This reduces the replica count by one. The operator chooses which replica is removed; opening a particular node does not select it for deletion. MySQL high-availability standbys are not individually removable read replicas.
Before removing the last replica, move applications off replica-only endpoints. For PostgreSQL and MariaDB, this also removes the remaining standby for failover. PostgreSQL's any-node proxy can still reach the primary, but it no longer offloads reads to replicas.
There is no dedicated rebuild action in the console. Contact support if a replica remains unhealthy rather than treating count changes as a targeted rebuild procedure.
Troubleshooting
High Replication Lag
Check the node's replication status and workload. Heavy writes, long transactions, and resource pressure can delay replay. Keep consistency-sensitive reads on the primary, review expensive queries, and consider resizing the database as a whole if resources are constrained.
Replica Connection Errors
- Check that replicas are ready in Nodes.
- Copy the current endpoint and port from Connectivity.
- Check that your application can reach the internal network when using a reader endpoint.
- Use the database's current credentials and TLS settings.
- Check whether you are accidentally sending writes through a reader or any-node endpoint.
If replication stays unhealthy or the displayed endpoints remain unavailable, contact support with the database name and observed error. Do not include passwords or private keys.