Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/configuration/pgdog.toml/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ Available options:

- `include_primary`
- `exclude_primary`
- `include_primary_if_replica_banned`

Include primary uses the primary database as well as the replicas to serve read queries. Exclude primary will send all read queries to replicas, leaving the primary to serve only writes.

Include primary if replica banned strategy will only send reads to the primary if one or more replicas have been banned. This is useful in case you want to use the primary as a failover for reads.

Default: **`include_primary`**

### `healthcheck_port`
Expand Down
9 changes: 9 additions & 0 deletions docs/features/load-balancer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ This behavior is configurable in [pgdog.toml](../../configuration/pgdog.toml/gen
read_write_split = "exclude_primary"
```

#### Failover for reads

In case one of your replicas fails, you can configure the primary to serve read queries temporarily while you (or your cloud vendor) bring the replica back up. This is configurable, like so:

```toml
[general]
read_write_split = "include_primary_if_replica_banned"
```

### Manual routing

!!! note "New feature"
Expand Down
Loading