Create Global Database from existing Aurora DB cluster

For the sake of time, in the previous CloudFormation scripts, we have automatically launched an Aurora MySQL cluster in the primary region whose version is ready and compatible with Aurora Global Database. We will now create a Global Database which will span across multiple regions.

Definitions

Amazon Aurora Global Database

An Amazon Aurora Global Database consists of one primary AWS Region where your data is mastered by the Primary Aurora DB cluster's Primary DB Instance for read and write operations, and one (or more) secondary AWS Region(s) where data is replicated to with typical latency of under a second. Applications with a worldwide footprint can use reader instances in the secondary AWS Region for low latency reads. In the unlikely event your database becomes degraded or isolated in the primary AWS region, you can promote the secondary AWS Region to take full read-write workloads in under a minute.

Amazon Aurora DB Cluster

An Amazon Aurora DB cluster is a regional logical construct that consists of one or more DB instances and a cluster volume that manages the data for those DB instances.

Amazon Aurora Primary DB Instance

An Amazon Aurora Primary DB Instance supports read and write operations, and performs all of the data modifications to the cluster volume. Each Aurora DB cluster has one primary DB instance.

Amazon Aurora Replica

An Amazon Aurora Replica supports only read operations, connects to the same Aurora Storage Engine volume as the Primary DB Instance. High availability can be achieved by locating Aurora Replicas in separate Availability Zones, in which Aurora will automatically perform failover in the event the primary DB Instance becomes unavailable.

Global Database - Add Region

Region 1 (Primary)

  1. Open RDS in the AWS Management Console. Ensure you are in your assigned region.

  2. Within the RDS console, select Databases on the left menu. This will bring you to the list of Databases already deployed. You should see gdb1-cluster and gdb1-node1.

  3. Select gdb1-cluster. Click on the Actions menu, and select Add Region. GDB Add Region

  4. You are now creating an Aurora Global Database, adding a new region DB cluster to be replicated from your primary region's Aurora DB cluster.

  5. Under Global database identifier. We will name our Global database as auroralabs-gdb

  6. For Secondary Region, use the drop down list and select your assigned secondary region Region 2 (Secondary). This can take a few seconds to load.

  7. Next, we have DB Instance Class. Aurora allows replicas and Global Database instances to be of different instance class and size. We will leave this as the default db.r5.large. GDB Settings 1

  8. For Multi-AZ deployment, we will leave this as the default value Don't create an Aurora Replica. For production, it is highly recommended to scale your read traffic to multiple reader nodes for even higher availability.

  9. For Virtual Private Cloud, we will click on the drop down list, and select gdb2-vpc. This is the dedicated VPC we created from CloudFormation for the secondary region.

  10. Expand on Additional connectivity configuration for more options.

  11. Under Existing VPC security groups, we will click on the drop down list, deselect default and select gdb2-mysql-internal. Attaching this security group allows our applications in the secondary region to reach the Aurora secondary DB Cluster. GDB Settings 2

    Be sure you have the proper VPC selected!

  12. Leave the other default options, scroll down to bottom of the page and expand on Additional configuration.

  13. For DB instance identifier, we will name the Aurora DB instance for the secondary region. Let's name this gdb2-node1

  14. Similarly, under DB cluster identifier, we will name the Aurora DB cluster for the secondary region. Let's name this gdb2-cluster

  15. Ensure the DB cluster parameter group and DB parameter groups are set to the ones with the gdb2- prefix. GDB Settings 3

  16. Near the bottom, under Monitoring, select the checkbox for Enable Enhanced Monitoring. We will vend metrics down to 60-second Granularity. Click on the drop-down menu and change Monitoring Role to the IAM role you have under gdb2-monitor-<xx-region-x> name. GDB Settings 4

    Please validate and review all settings before moving on

    Before moving on, please re-validate all your settings, anything that's not explicitly called out in the instructions here can be left on the default values. Remember, some database settings and configurations are immutable after creation.

  17. After confirming carefully that we have everything in order, press the Add Region button.

  18. You will then be returned to the main RDS console and see that the Aurora DB Cluster and DB Instance in your secondary region is being provisioned. This will take about 15-20 minutes and the Secondary DB cluster and new DB instance reader will report as Available. You can move on to the next step while this is still being created. GDB Settings 5

Checkpoint

At this point, you have created the Global Database, expanded the Aurora DB cluster from your primary region to replicate data over to the secondary region.

Global Database Creation Architecture Diagram