4

When using Elastic Beanstalk with CNAME swapping for zero downtime deployments, DNS caching (clients not respecting TTL) causes some clients to continue sending traffic to the old environment (for up to several days).

When using Elastic Beanstalk with Route53 Aliases for zero downtime deployments, does DNS caching remain an issue?

max
  • 617
  • 8
  • 20

3 Answers3

1

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.CNAMESwap.html it says

you deploy the new version to a separate environment, and then swap CNAMEs of the two environments to redirect traffic to the new version instantly.

and

However, do not terminate your old environment until the DNS changes have been propagated and your old DNS records expire. DNS servers do not necessarily clear old records from their cache based on the time to live (TTL) you set on your DNS records.

isn't it conflict? I think DNS caching is still an issue.

How can I migrate the DB to a new version while older version clients exist. I guess I can migrate db only when it works for both two version.

I've found a good article here. http://fbrnc.net/blog/2016/05/green-blue-deployments-with-aws-lambda-and-cloudformation but it use Cloud Formation, not Elastic Beanstalk.

Kennyhyun
  • 1,032
  • 1
  • 10
  • 14
0

Unfortunately it does. The recommended way now is to use rolling updates.

aldrinleal
  • 3,559
  • 26
  • 33
  • My understanding of rolling updates is that you can only use it to update AWS instance configurations - ie. one instance vs pool of instances, instance size, etc. Can you use rolling updates to update application code? – max Jan 27 '15 at 00:49
  • Yes. When you are using Elastic Beanstalk, if you deploy a new version of your application to an EB application, it will do an in-place update of your app on the existing instances. If there's a problem, you re-deploy the old version. But this means you cannot do blue/green or red/black deployments. – Matt Houser Jan 27 '15 at 01:24
  • @MattHouser, is an in-place update the same thing as a rolling update / zero downtime update? – max Jan 27 '15 at 03:03
  • Amazon's use of in-place update suggests down time: "Because AWS Elastic Beanstalk performs an in-place update when you update your application versions, you will experience some downtime." http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.CNAMESwap.html – max Jan 27 '15 at 03:05
  • Yes an in-place update does result in some downtime. It could be a few seconds or a few minutes. A rolling update means the instances are updated some-at-a-time rather than all at the same time. A rolling update is an in-place update. But I think a rolling update will shuffle users around to avoid noticable downtime. – Matt Houser Jan 27 '15 at 03:16
  • Just saw this over on amazon forums, unfortunately: "The new rolling update feature does not apply to application deployment, only to Beanstalk environment changes that require the replacement of instances like adding an instance profile." https://forums.aws.amazon.com/thread.jspa?messageID=502158񺦎 – max Jan 27 '15 at 04:42
0

I havent tested this yet but I thought this was why they implemented the "Swap Environment URLs" action, rather than doing it in route53.

Reference

Bryan
  • 95
  • 1
  • 2
  • 8
  • Unfortunately, the environment URL swap works by changing the DNS CNAME value for the "outwardly facing" domain, which still has the TTL / DNS cache issues. – max Jan 29 '15 at 05:29