Aws Route53 to Aws RDS CNAME TTLs

Viewed 924

I'm setting an AWS Route53 CNAME alias to an AWS RDS Cluster endpoint. The purpose of this is to create a consistent DNS entry that will always redirect to the current cluster endpoint. However, I'm not sure what to set the CNAME TTL too.

ex.

  • R53 DNS (CNAME) => RDS Cluster DNS
  • db.myapp.com => cluster-abc.could-change.aws.com

AWS sets the TTL on their Cluster endpoint to 5 sec so that it can redirect to the active writer during a fail-over. When I first created the CNAME I mimic'ed that 5 sec, but I'm afraid that means it'll be forced to do two DNS lookups every 5 sec. One to get the latest CNAME value, and another to that endpoint to get the current IP.

Is this assumption correct? If so would you suggest I set the custom DNS CNAME TTL to something like 60 sec? That way systems using that custom DNS only re-query the CNAME value every 60 sec, but query the Cluster endpoint every 5 sec as expected?

Also, I know the suggestion is to set a higher TTL on DNS, but if it's higher than a few minutes it'll be possible that a system could try to use a cluster that's already been replaced.

0 Answers
Related