Creating a DB instance read replica from a Multi-AZ DB cluster (original) (raw)

You can create a DB instance read replica from a Multi-AZ DB cluster in order to scale beyond the compute or I/O capacity of the cluster for read-heavy database workloads. You can direct this excess read traffic to one or more DB instance read replicas. You can also use read replicas to migrate from a Multi-AZ DB cluster to a DB instance.

To create a read replica, specify a Multi-AZ DB cluster as the replication source. One of the reader instances of the Multi-AZ DB cluster is always the source of replication, not the writer instance. This condition ensures that the replica is always in sync with the source cluster, even in cases of failover.

Topics

Comparing reader DB instances and DB instance read replicas

A DB instance read replica of a Multi-AZ DB cluster is different than the reader DB instances of the Multi-AZ DB cluster in the following ways:

For more information about reader and writer DB instances, see Multi-AZ DB cluster architecture.

Considerations

Consider the following before you create a DB instance read replica from a Multi-AZ DB cluster:

Creating a DB instance read replica

You can create a DB instance read replica from a Multi-AZ DB cluster using the AWS Management Console, AWS CLI, or RDS API.

Note

We strongly recommend that you create all read replicas in the same virtual private cloud (VPC) based on Amazon VPC of the source Multi-AZ DB cluster.

If you create a read replica in a different VPC from the source Multi-AZ DB cluster, Classless Inter-Domain Routing (CIDR) ranges can overlap between the replica and the RDS system. CIDR overlap makes the replica unstable, which can negatively impact applications connecting to it. If you receive an error when creating the read replica, choose a different destination DB subnet group. For more information, see Working with a DB instance in a VPC.

To create a DB instance read replica from a Multi-AZ DB cluster, complete the following steps using the AWS Management Console.

  1. Sign in to the AWS Management Console and open the Amazon RDS console athttps://console.aws.amazon.com/rds/.
  2. In the navigation pane, chooseDatabases.
  3. Choose the Multi-AZ DB cluster that you want to use as the source for a read replica.
  4. For Actions, choose Create read replica.
  5. For Replica source, make sure that the correct Multi-AZ DB cluster is selected.
  6. For DB identifier, enter a name for the read replica.
  7. For the remaining sections, specify your DB instance settings. For information about a setting, see Settings for DB instances.
Note

The allocated storage for the DB instance read replica must be the same as the allocated storage for the source Multi-AZ DB cluster. 8. Choose Create read replica.

To create a DB instance read replica from a Multi-AZ DB cluster, use the AWS CLI command create-db-instance-read-replica. For--source-db-cluster-identifier, specify the identifier of the Multi-AZ DB cluster.

For Linux, macOS, or Unix:

aws rds create-db-instance-read-replica \
  --db-instance-identifier myreadreplica \
  --source-db-cluster-identifier mymultiazdbcluster

For Windows:

aws rds create-db-instance-read-replica ^
  --db-instance-identifier myreadreplica ^
  --source-db-cluster-identifier mymultiazdbcluster

To create a DB instance read replica from a Multi-AZ DB cluster, use the CreateDBInstanceReadReplica operation.

If you no longer need the DB instance read replica, you can promote it into a standalone DB instance. When you promote a read replica, the DB instance is rebooted before it becomes available. For instructions, see Promoting a read replica to be a standalone DB instance.

If you're using the read replica to migrate a Multi-AZ DB cluster deployment to a Single-AZ or Multi-AZ DB instance deployment, make sure to stop any transactions that are being written to the source DB cluster. Then, wait for all updates to be made to the read replica. Database updates occur on the read replica after they occur on one of the reader DB instances of the Multi-AZ DB cluster. This replication lag can vary significantly. Use theReplicaLag metric to determine when all updates have been made to the read replica. For more information about replica lag, see Monitoring read replication.

After you promote the read replica, wait for the status of the promoted DB instance to be Available before you direct your applications to use the promoted DB instance. Optionally, delete the Multi-AZ DB cluster deployment if you no longer need it. For instructions, see Deleting a Multi-AZ DB cluster for Amazon RDS.

Limitations for creating a DB instance read replica from a Multi-AZ DB cluster

The following limitations apply to creating a DB instance read replica from a Multi-AZ DB cluster deployment.