11

I have inherited a collection of RDS MySQL instances with random (useless) DB Instance names.

I often have to dig into the tags section to find out which project they belong to.

One of the settings I can modify in an RDS is the DB Instance Identifier.

If I change this, what will happen besides for the name change? Will it affect anybody's code? Or is it a harmless change?

These are live systems that I cannot afford to bring down.

2 Answers 2

10

Yes, you can rename an RDS instance... at your own peril.

When you rename a DB instance, the [DNS] endpoint [hostname] for the DB instance changes, because the URL includes the name you assigned to the DB instance.

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RenameInstance.html

Your application code requires configuration changes to be coordinated, for this reason.

See the link above for the other implications. This is a supported and generally safe operation, but only in your maintenance window, because there will necessarily be a brief disruption as the DNS is changed and your app code is cycled in with the new database hostname.

3

Yes you can change the name of the RDS instance, but it is highly discouraged to do so in LIVE Production environment. It would change the EndPoint which might impact other resources actively accessing the RDS server (like an application server).

This would probably require a property / env-variable change in your code or configs (which would ideally end up for a release of config through config management)

To avoid disruption (In future) and rollout changes with lesser RTO , you can create an intermediate DNS entry (CNAME) in Route53 for your RDS server and use the intermediate URL in your application. When the RDS server name changes you could just change the DNS CNAME of the new RDS Endpoint. NOTE: During the name change your RDS server would be unavailable (with old name) for few minutes and this might cause disruption

That being said, you are already biased on a solution (change of RDS names) for your problem. BuT

There are multiple solutions for your actual problem (managing RDS servers for each project)

A. Try to avoid using AWS Console as much as possible. Why dont you start looking into AWS CLI (which can pull the tags) and write a wrapper Python/Bash script to list all the RDS servers - with Project Names, from this output you could manage these servers, like take a snapshot , backup etc. You can also use mysql --login-path (If you are on mysql for DB administration) https://opensourcedbms.com/dbms/passwordless-authentication-using-mysql_config_editor-with-mysql-5-6/.

B. (Cost agnostic approach) If you have anyways decided to change the RDS Names, then there is something you can do without any impact.

B.1 When the next code/config release happens try to bring in the intermediate DNS change into action.

B.2 (Optional) Enable Multi AZ in RDS (HA and twice the price). This will help your application to access the secondary active slave when there is any disruption due to name change. There is an option called Reboot with failover which would reboot the master while failing over to the active secondary 

B.3 Enable replication (read-replica) (this will give you a new RDS end-point). Name the read replica properly with your project names

B.4. Once replication is complete (and during your SLA / maintenance window) promote your read replica (this will break replication) and make the intermediate DNS point to the new RDS (with your proper names)

NOTE All the above approaches would not guarantee data integrity and improper data updates due to in-flight transactions. So it is always better to stop all transactions (by stopping all application accessing and deploying a maintenance page and do the operations)

3
  • I appreciate your input, though I have noticed that the weird (useless) names come specifically from using the CLI. Creating an RDs instance from the console gives them meaningful names. Aug 13, 2017 at 11:27
  • it is also very difficult (impossible?) to do billing analysis from the CLI, as well as watching usage graphs. Aug 13, 2017 at 11:28
  • 1
    #1 Ohh, for creation you can take a look at Cloudformation (where you can define the RDS names), when I said CLI I was referring to reading RDS list (for easy parsing in grep use --output=text. #2 and yes for billing analysis, console is a must, you should consider creating an IAM user with billing-role and hand it over to your finance person. Aug 14, 2017 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.