ThoughtWorksStudios / eb_deployer

AWS Elastic Beanstalk blue-green deployment automation from ThoughtWorks Mingle Team
MIT License
400 stars 94 forks source link

Does eb_deployer use CNAME swapping? #32

Closed maxbrodie closed 9 years ago

maxbrodie commented 9 years ago

Hi - what method does eb_deployer uses to swap between EB environments?

I've read CNAME Swap / Route53 Alias relies on DNS TTL, which is not necessarily respected by clients and could cause traffic to continue to old versions for up to two days.

Thanks.

betarelease commented 9 years ago

Hi Max, eb_deployer uses CNAME swapping as shown in

eb_deployer/lib/eb_deployer/aws_driver/beanstalk.rb

Any DNS update has to propagate through the internet and DNS servers only update based on TTL they have set on their end. So to propagate such changes you will have to wait till the internet has update all through the chain of DNS servers.

To circumvent that you could use a combination of ELB and Route53. So the only system affected by your CNAME swap is ELB and it will update as soon as you want. In this solution, you would use an ELB that is associated with your sitename, and then the blue/green instances behind the ELB routed using your own Route53 instance. This way when you switch between blue/green only the ELB needs to be updated and you would not have to worry about DNS TTL.

Sudhindra.

maxbrodie commented 9 years ago

Thanks Sudhindra. Just came across this - haven't used it yet, but at first glance appears to be an alternative to cname swapping / route53 for zero downtime deployments:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html

betarelease commented 9 years ago

That is what we recommend. Watch this video for more

https://www.youtube.com/watch?v=U06-QLd4FL4

We did speak about eb_deployer in the later part but in the first part Chris from AWS EB team explains all the details.

Sudhindra.

On Wed, Jan 28, 2015 at 10:21 AM, maxbrodie notifications@github.com wrote:

Just came across this - haven't used it yet, but at first glance appears to be an alternative to cname swapping / route53 for zero downtime deployments:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html

— Reply to this email directly or view it on GitHub https://github.com/ThoughtWorksStudios/eb_deployer/issues/32#issuecomment-71886660 .

Sudhindra. @sudhindraRao