With the PATCH request, you can update the replication mode of the PostgreSQL cluster.
Note:
PostgreSQL deprecates SYNCHRONOUS replication mode for new clusters.
You can update the existing clusters from SYNCHRONOUS mode to either ASYNCHRONOUS or
STRICTLY_SYNCHRONOUS using this API.
Which replication mode to choose?
Use ASYNCHRONOUS when you prioritize write performance and can tolerate potential data loss on failover.
Use STRICTLY_SYNCHRONOUS when data durability is critical, and you have at least 3 replicas.
What are the potential impacts of switching replication modes?
Switching to ASYNCHRONOUS from SYNCHRONOUS mode should not pose any downtime.
If you are using an ASYNCHRONOUS or SYNCHRONOUS cluster with less than 3 replicas and you decide to switch to the STRICTLY_SYNCHRONOUS mode (which requires 3 replicas at least),
You might experience some time where the DB is read-only.
The downtime is because the replication mode on writes needs confirmation from at least one synchronous-standby, and the primary is not allowed to continue in the standalone mode. For more information, see Replication Mode.
Important: If you are switching to STRICTLY_SYNCHRONOUS mode, we recommend:
Performing the replication mode switch outside of the critical business hours.
You should first update to 3 replicas, wait for them to be ready, and only then change to STRICTLY_SYNCHRONOUS mode.
Endpoint
Use the following endpoint to update the replication mode for an existing PostgreSQL cluster:https://api.ionos.com/databases/postgresql/clusters/{clusterId}
Note: The sample UUID is 498ae72f-411f-11eb-9d07-046c59cc737e.