# Configure high availability > Add standby instances to an Orchard managed database and choose when a write counts as saved. Source: https://docs.orchard.hackclub.com/data/high-availability/ A database with one instance has no failover: if its node fails, the database is down until the instance comes back. Standby instances keep a copy of the primary, so one of them can take over when the primary fails. To configure high availability, add a standby, then choose a replication mode that sets how much data a failover can lose. ## Prerequisites - Edit access to the project: the Admin or Member [project role](/teams/organizations/#project-roles). - A dedicated database. - Available [quota](/teams/quotas/) for each new instance. ## Add a standby 1. Open the database. 2. Go to **Settings** > **Resources**. 3. In **Instances**, increase the number of instances. 4. Select **Scale to ``**. The **Instances** list shows each instance as **Primary** or **Standby**, with its status. A new standby copies the primary before it serves traffic. ## Choose a replication mode The replication mode controls when Postgres treats a write as saved. | Mode | Behavior | Needs a standby | | ------------- | -------------------------------------------------------------------------- | --------------- | | **Async** | A failover can lose the last moments of writes. | No | | **Preferred** | Each commit waits for a standby while one is healthy. | Yes | | **Required** | No acknowledged write is lost, but writes stop if no standby is reachable. | Yes | **Dashboard** 1. Open the database. 2. Go to **Settings** > **High availability**. 3. Select a mode. Orchard saves the mode immediately. **CLI** ```sh orchard db replication set --mode preferred ``` To read the current mode, run the following command: ```sh orchard db replication get ``` ## Remove a standby > **Caution** > > Removing a standby deletes the standby and its volume. 1. Open the database. 2. Go to **Settings** > **Resources**. 3. In **Instances**, decrease the number of instances. 4. Select **Scale to ``**. 5. In the confirmation dialog, select **Scale to ``**. The primary keeps running. Standbys also serve read-only traffic. To send reads to them, refer to [Read replicas](/data/replicas/). ## Related resources - [Monitor a database](/data/monitoring/) - Watch the **Replication lag** panel. - [`orchard db replication` reference](/reference/cli/#db) - Review the replication commands.