PostgreSQL read-only replicas allow you to perform read-only queries against the replica and reduce the load on the primary server. You can optimize query response times across different geographical locations because the replica can be created in different regions or on different cloud providers. For information about creating a read-only replica using the Aiven client, see the documentation on creating a read replica using the CLI.
If you are running a Managed Service for TimescaleDB Pro plan, you have standby nodes available in a high availability setup. The standby nodes support read-only queries to reduce the effect of slow queries on the primary node.
Sign in to your Managed Service for TimescaleDB portal, and click the service for which you want to create a remote replica.
Create a read replica.
Create a PostgreSQL read replicapage, type a name for the remote replica, select the cloud provider, location, plan that you want to use, and click
When the read-only replica is created it is listed as a service in your
Overview tab of the replica also lists the name of the primary
service for the replica. To promote a read-only replica as a master database,
Promote to master button.
Overviewpage of the read-only replica for the service on MST, copy the
At the psql prompt, connect to the read-only service:psql <SERVICE_URI>
To check whether you are connected to a primary or replica node:SELECT * FROM pg_is_in_recovery();
If the output is
TRUEyou are connected to the replica, and if the output is
FALSEyou are connected to the primary server.
Managed Service for TimescaleDB uses asynchronous replication, so some lag is expected. When you run an
INSERT operation on the primary node, a small delay of less than a second is expected for the change to propagate to the replica.
Found an issue on this page?Report an issue!