---
title: "High Availability"
description: "What redundancy each Managed PostgreSQL plan family provides, what you control about failover, and how standbys differ from read replicas."
url: https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/high-availability/
product: "PostgreSQL"
section: product
last_updated: 2026-11-10
---
> For AI agents: the documentation index is at https://community.exoscale.com/llms.txt. Every page is available as markdown at `<page URL>index.md` or with `Accept: text/markdown`.

# High Availability

This page explains what redundancy each plan family gives you, what you control about failover, and how a standby node differs from a read replica.

## Nodes by Plan Family

The number of nodes is fixed by the plan. There is no separate switch for high availability: you
get standby nodes by choosing a plan family with more than one node.

| Plan family | Nodes | Topology |
| --- | --- | --- |
| `hobbyist-*`, `startup-*`, `cpu-startup-*`, `so-startup-*` | 1 | Single node |
| `business-*`, `cpu-business-*`, `so-business-*` | 2 | Primary and one standby |
| `premium-*`, `cpu-premium-*`, `so-premium-*` | 3 | Primary and two standbys |

Read the node count of every plan with:

```bash
exo dbaas type show pg --plans
```

A standby is a copy of the primary inside the same service, in the same zone, kept up to date by
streaming replication. It exists to take over when the primary fails, without a restore from
backup. A single-node service has no standby: if its node is lost, the service has to be rebuilt
from its backups.

Because all the nodes of a service run in one zone, standbys protect against the loss of a node,
not of a zone. For a copy in another zone, use a
[read replica](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/use-read-replicas/index.md).

The availability target of each plan family is in the [DBaaS SLA](https://community.exoscale.com/product/dbaas/service-boundaries/sla/index.md).
Moving between families is a plan change, see
[Change the service plan](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/change-the-plan/index.md).

## Replication to Standbys Is Asynchronous

The primary does not wait for a standby before it confirms a commit. The service setting `synchronous-replication` accepts `off` and `quorum`, but `quorum` is refused
on the plans tested (`startup-4`, `business-4`, `premium-4`) with
`Synchronous replication not available for current plan`.

When the primary fails, the transactions it committed and had not yet sent to a standby are lost.

## Commits Are Acknowledged Before They Reach Disk

`synchronous_commit` is `off` on Managed PostgreSQL, while upstream PostgreSQL defaults to `on`:

```sql
SHOW synchronous_commit;
```

With `off`, PostgreSQL reports a commit as successful before its WAL record is flushed to disk.
The [PostgreSQL documentation on asynchronous commit](https://www.postgresql.org/docs/current/wal-async-commit.html)
describes the consequence: if the server crashes, the transactions committed in the last moments
before the crash are lost, up to three times `wal_writer_delay`, which is `200ms` on the service.
The database stays consistent: a lost transaction disappears as a whole.

The service-level value cannot be changed: the API answers
`No data to update the service`. The parameter has the `user` context, so `avnadmin`
can turn it on for a transaction, a role or a database:

```sql
BEGIN;
SET LOCAL synchronous_commit = on;
-- the writes that must not be lost
COMMIT;
```

```sql
ALTER ROLE ROLE_NAME SET synchronous_commit = on;
```

```sql
ALTER DATABASE DATABASE_NAME SET synchronous_commit = on;
```

Parameters:

- `ROLE_NAME`: the role whose sessions should wait for the flush, for example your application user.
- `DATABASE_NAME`: the database whose sessions should wait for the flush, for example `defaultdb`.

Role and database settings apply to new sessions. With `on`, a commit waits until its WAL is on
the primary's disk. It still does not wait for a standby, so a failover can lose the most recent
transactions. Each commit also pays the latency of a disk flush.

## Failover

Failover to a standby is automatic. There is no API operation to promote a standby, to move the
primary role to another node, or to trigger a failover on demand, so a failover cannot be
rehearsed. Rehearse recovery with a fork instead, see
[Plan for disaster recovery](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/plan-disaster-recovery/index.md).

The failover detection is run by `pglookout`. Its one setting is how long the primary must be
unavailable before a standby is promoted:

| Setting | Minimum | Default | Meaning |
| --- | --- | --- | --- |
| `max_failover_replication_time_lag` | 10 | 60 | Seconds of primary unavailability before failover to a standby |

```bash
echo '{"pglookout-settings":{"max_failover_replication_time_lag":90}}' | \
  exo api update-dbaas-service-pg SERVICE_NAME -z ZONE
```

Parameters:

- `SERVICE_NAME`: name of the service, for example `my-postgresql`.
- `ZONE`: zone of the service, for example `ch-gva-2`.

A lower value fails over sooner after a real outage, and also on a shorter network interruption.

## Prepare the Application for a New Primary

The hostname of the service stays the same after a failover; the address behind it changes. A
promoted standby is another PostgreSQL server: the sessions open on the old primary are gone, and
so is their state (uncommitted transactions, temporary tables, prepared statements, `SET` values,
advisory locks, `LISTEN` registrations). The same happens when nodes are replaced during a
[plan change](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/change-the-plan/index.md#what-a-plan-change-does-to-your-connections)
or maintenance.

> [!WARNING]
> Treat a dropped connection as a normal event. Use a client-side pool that validates connections
> and reconnects, keep transactions short, and make writes safe to retry.

## Standbys Are Not Read Replicas

|  | Standby node | Read replica |
| --- | --- | --- |
| What it is | A node inside the service | A separate service, with its own name, plan and URI |
| Comes from | The plan (`business-*`, `premium-*`) | A `read_replica` integration you create |
| Zone | The zone of the service | Any zone |
| Purpose | Taking over from a failed primary | Serving read-only queries, a copy in another zone |
| Becomes a primary | Automatically, on failover | Only when you promote it |
| Billing | Included in the plan | Billed as a service of its own |

To check which kind of server you are connected to:

```sql
SELECT pg_is_in_recovery();
```

`true` means a replica or a standby, `false` a primary.

See [Use read replicas](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/use-read-replicas/index.md) to
create and promote a replica.

## Related Pages

- [Backups and point-in-time recovery](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/backups-and-pitr/index.md)
- [Service architecture](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/service-architecture/index.md)
- [Use read replicas](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/use-read-replicas/index.md)
- [Scale DBaaS services](https://community.exoscale.com/product/dbaas/how-to/scaling/index.md)
- [SLA](https://community.exoscale.com/product/dbaas/service-boundaries/sla/index.md)

