why must an RDS always have two subnets

0

Hello,

Tried asking this on acloudguru as I was going through some courses on AWS, but no luck. Maybe I will get lucky here? :)

Trying to understand RDS deployment better.

When I create an RDS instance, it requires me to define two subnets. Even if I just deploy a single instance (non-multi AZ, even backups disabled though that should not be related).

What are the who subnets used for?

I read various discussions all over the internet, stating some thing like:

-If you change to multi-AZ, then these two are used as a basis. But why would you need to pre-define it before going multi-AZ?

-The second subnet would be used to store your backups and logs. But elsewhere I read those are actually put into S3. What is it?

-That AWS uses these two subnets to deploy your RDS. Does it then randomly pick one subnet, deploy the RDS there, and keep it there forever? What is the need for the second subnet then?

-That in case of failure, AWS would automatically transition the RDS to the second subnet. This kind of makes sense, but does this really happen? If so, when does the transition get triggered, what kind of downtime is to be expected, is the new RDS built from latest backup? What if I disabled the backup?

-Some other reason?

I found this old thread here asking the same question: https://forums.aws.amazon.com/thread.jspa?messageID=542662䟆

But even that question/answers lists two different options from the AWS staff: one answer saying just in case you decide to go multi-AZ, and/or a second answer saying it provides automated failover. See questions above.

Thanks,

asked 5 years ago3776 views
2 Answers
1

Hi,
Amazon RDS FAQs actually address this very question.
Link: https://aws.amazon.com/rds/faqs/

For Multi-AZ deployments, defining a subnet for all Availability Zones in a Region will allow Amazon RDS to create a new standby in another Availability Zone should the need arise. You need to do this even for Single-AZ deployments, just in case you want to convert them to Multi-AZ deployments at some point.

Q: The second subnet would be used to store your backups and logs
A: No, the second subnet is NOT used for backups and logs.

Q: That AWS uses these two subnets to deploy your RDS. Does it then randomly pick one subnet, deploy the RDS there, and keep it there forever? What is the need for the second subnet then?
A: On RDS creation, you are allowed to choose an Availability zone preference. If you choose "No preference", then RDS will randomly choose to deploy one of the subnets and will keep it there forever (unless you update config to Multi-AZ). The second subnet is just sitting there doing nothing waiting for you to upgrade to Multi-AZ.

Q: That in case of failure, AWS would automatically transition the RDS to the second subnet.
A: No, it will only transition to the second subnet if Multi-AZ is enabled

Q: If you change to multi-AZ, then these two are used as a basis. But why would you need to pre-define it before going multi-AZ?
A: Most likely because AWS would rather you use multi-AZ (and also wants the migration to multi-AZ be as simple as a possible).

Hope this helps!
-randy

answered 5 years ago
0

ok thanks. i missed that. i guess it must be something to do with the backend implementation to ease the conversion later if needed. in any case, thanks for the answer!

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions