Cross region RDS replication with customized parameter group

selvackp
3 min readMar 7, 2021

--

Having Cross region RDS replication is good for Disaster recovery as well as oversees customer report latency will be minimal to all the users

Creating cross region replication is easy on AWS Cloud and we can achieve this less than a minute . Once we are ready with secondary region VPC , DB Subnet Groups proceed to create on single click

By default , AWS create RDS with default parameter group ,

But modifying default parameter group isn’t possible , anyway few important server variables needs to adjust for application requirements ( Exa : max_connections , wait_timeout .. )

In this case , we have customized parameter group for application requirements as below ,

  1. lower_case_table_names to 1
  2. max_connections to 5000
  3. max_connect_errors to 10000

When we started to creating cross region replication , RDS creation took more hours and unable to succeed , when we check our support its required to launch instance with customized parameter group

But in AWS console level , its not possible to assign customized parameter group and launch mysql RDS in cross region ,

Only possibility to achieve this cross region replication using AWS CLI and pass appropriate option to create read replica ,

We must have appropriate permissions to create read replica in another region , in this case am having administrator access with programmatic access

Using AWS CLI set the default region to make it easy way ,

We are ready to create read replica with customized parameter group . Just run below script to launch read replica , Please specify different options on highlighted as per your requirements ,

aws rds create-db-instance-read-replica — db-instance-identifier rds-replica — source-db-instance-identifier arn:aws:rds:us-east-1:64538572731:db:datamysql — db-instance-class db.r5.large — port 3306 — db-subnet-group-name default-vpc-a72502c0 — no-multi-az — no-auto-minor-version-upgrade — db-parameter-group-name datamysql57 — source-region ap-southeast-1

After few more minutes , read replica will be available to stream the data in cross region

Note : We must enable automated backup to create cross region replication

--

--