Creating read replicas for Amazon RDS on AWS Outposts
Amazon RDS on AWS Outposts uses the MySQL and PostgreSQL DB engines' built-in replication functionality to create a read replica from a source DB instance. The source DB instance becomes the primary DB instance. Updates made to the primary DB instance are asynchronously copied to the read replica. You can reduce the load on your primary DB instance by routing read queries from your applications to the read replica. Using read replicas, you can elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads.
When you create a read replica from an RDS on Outposts DB instance, the read replica uses a customer-owned IP address (CoIP). For more information, see Customer-owned IP addresses for Amazon RDS on AWS Outposts.
Read replicas on RDS on Outposts have the following limitations:
-
You can't create read replicas for RDS for SQL Server on RDS on Outposts DB instances.
-
Cross-Region read replicas aren't supported on RDS on Outposts.
-
Cascading read replicas aren't supported on RDS on Outposts.
-
The source RDS on Outposts DB instance can't have local backups. The backup target for the source DB instance must be your AWS Region.
-
Read replicas require customer-owned IP (CoIP) pools. For more information, see Customer-owned IP addresses for Amazon RDS on AWS Outposts.
Read replicas on RDS on Outposts can only be created in the same virtual private cloud (VPC) as the source DB instance.
Read replicas on RDS on Outposts can be located on the same Outpost or another Outpost in the same VPC as the source DB instance.
You can't create read replicas for DB instances encrypted with AWS KMS External Key Store (XKS).
You can create a read replica from an RDS on Outposts DB instance using the AWS Management Console, AWS CLI, or RDS API. For more information on read replicas, see Working with DB instance read replicas.
To create a read replica from a source DB instance
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the navigation pane, choose Databases.
-
Choose the DB instance that you want to use as the source for a read replica.
-
For Actions, choose Create read replica.
-
For DB instance identifier, enter a name for the read replica.
-
Specify your settings for Outposts Connectivity. These settings are for the Outpost that uses the virtual private cloud (VPC) that has the DB subnet group for your DB instance. Your VPC must be based on the Amazon VPC service.
-
Choose your DB instance class. We recommend that you use the same or larger DB instance class and storage type as the source DB instance for the read replica.
-
For Multi-AZ deployment, choose Create a standby instance (recommended for production usage) to create a standby DB instance in a different Availability Zone.
Creating your read replica as a Multi-AZ DB instance is independent of whether the source database is a Multi-AZ DB instance.
-
(Optional) Under Connectivity, set values for Subnet Group and Availability Zone.
If you specify values for both Subnet Group and Availability Zone, the read replica is created on an Outpost that is associated with the Availability Zone in the DB subnet group.
If you specify a value for Subnet Group and No preference for Availability Zone, the read replica is created on a random Outpost in the DB subnet group.
-
For AWS KMS key, choose the AWS KMS key identifier of the KMS key.
The read replica must be encrypted.
-
Choose other options as needed.
-
Choose Create read replica.
After the read replica is created, you can see it on the Databases page in the RDS console. It shows Replica in the Role column.
To create a read replica from a source MySQL or PostgreSQL DB instance, use the AWS CLI command create-db-instance-read-replica.
You can control where the read replica is created by specifying the --db-subnet-group-name
and
--availability-zone
options:
-
If you specify both the
--db-subnet-group-name
and--availability-zone
options, the read replica is created on an Outpost that is associated with the Availability Zone in the DB subnet group. -
If you specify the
--db-subnet-group-name
option and don't specify the--availability-zone
option, the read replica is created on a random Outpost in the DB subnet group. -
If you don't specify either option, the read replica is created on the same Outpost as the source RDS on Outposts DB instance.
The following example creates a replica and specifies the location of the read replica by including
--db-subnet-group-name
and --availability-zone
options.
Example
For Linux, macOS, or Unix:
aws rds create-db-instance-read-replica \ --db-instance-identifier
myreadreplica
\ --source-db-instance-identifiermydbinstance
\ --availability-zoneus-west-2a
For Windows:
aws rds create-db-instance-read-replica ^ --db-instance-identifier
myreadreplica
^ --source-db-instance-identifiermydbinstance
^ --availability-zoneus-west-2a
To create a read replica from a source MySQL or PostgreSQL DB instance, call the Amazon RDS API CreateDBInstanceReadReplica operation with the following required parameters:
-
DBInstanceIdentifier
-
SourceDBInstanceIdentifier
You can control where the read replica is created by specifying the DBSubnetGroupName
and
AvailabilityZone
parameters:
-
If you specify both the
DBSubnetGroupName
andAvailabilityZone
parameters, the read replica is created on an Outpost that is associated with the Availability Zone in the DB subnet group. -
If you specify the
DBSubnetGroupName
parameter and don't specify theAvailabilityZone
parameter, the read replica is created on a random Outpost in the DB subnet group. -
If you don't specify either parameter, the read replica is created on the same Outpost as the source RDS on Outposts DB instance.