# How to Add Standby Nodes to MySQL Database Clusters MySQL is an open source, object-relational database built with speed and reliability in mind. Its large and active developer community has created many third-party applications, tools, and libraries that expand MySQL’s functionality. In a database cluster, standby nodes maintain a copy of the primary node. If the primary node fails, a standby node is automatically promoted to replace it. Additionally, standby nodes can direct routing for read traffic. MySQL clusters can have up to two standby nodes. **Note**: Standby nodes differ from [read-only nodes](https://docs.digitalocean.com/products/databases/mysql/how-to/add-read-only-nodes/index.html.md), which provide geographically distinct horizontal read scaling. You can add standby nodes during cluster creation in the [cluster configuration section](https://docs.digitalocean.com/products/databases/mysql/how-to/create/index.html.md#choose-a-cluster-configuration) of the create page. You can also add standby nodes to an existing database cluster. From the **Databases** page, click the name of the cluster to go to its **Overview** page, then click the **Settings** tab. ![Screenshot of cluster settings page](https://docs.digitalocean.com/screenshots/databases/mysql-cluster-settings.488ffff00c3371397115f53a0ac7c13f25254636a58e80d5adf3efb0f9fdb999.png) On the **Settings** page, in the **Cluster configuration** section, click **Edit**. Open the **Standby Nodes** drop-down and choose the number of standby nodes. **Note**: Due to the memory requirements of replication, standby nodes are only supported for plans with 2 GB of RAM or more. ![Screenshot of Add Standby Nodes](https://docs.digitalocean.com/screenshots/databases/cluster-add-standby.d95b2161700329cac18221112ebe3be363fc9bc78f2e79078f4e919b94b6ce4e.png) When you’re done, click **Save** to immediately provision the standby nodes. The time to complete varies depending on the size of the primary node and its data, but we recommend allowing at least 5 minutes. ## Use Standby Nodes for Reads You can also use standby nodes for reads, to improve your cluster’s performance. However, doing so can result in the standby nodes being too overwhelmed to properly replace the primary node in case of failure. To use standby nodes for reads, you can find the standby nodes’ hostname via the API. ## How to Retrieve an Existing Database Cluster Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a GET request to [`https://api.digitalocean.com/v2/databases/{database_cluster_uuid}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/databases_get_cluster). ### cURL Using cURL: ```shell curl -X GET \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() cluster, _, err := client.Databases.Get(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30") } ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) get_resp = client.databases.get_cluster(database_cluster_uuid="a7a89a") ``` And you can find the standby nodes’ IP addresses by querying DNS. To connect to the standby node, add the `replica-` prefix to the primary cluster connection URL. For example: ``` dig +short A replica-db-redis-tutorial-redis-watch-local-do-user-0.c.db.ondigitalocean.com 123.45.67.89 123.456.78.901 ``` Traffic you send to multiple standby nodes is not load balanced. In order to load balance this traffic, you can either use a client that does it natively or look up the IPs with a tool such as `dig`.