Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Use Elastic Beanstalk Blue/Green Deployment to Reduce Downtime & Risk (DEV330-R1) - AWS re:Invent 2018

1,197 views

Published on

Blue/green deployment is a technique used to release applications by shifting traffic between two identical environments running different versions of an application. Come and learn how AWS Elastic Beanstalk makes blue/green deployments easy and helps you mitigate common risks associated with deploying software while avoiding downtime.

  • Be the first to comment

Use Elastic Beanstalk Blue/Green Deployment to Reduce Downtime & Risk (DEV330-R1) - AWS re:Invent 2018

  1. 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Use Elastic Beanstalk Blue-Green Deployments to Reduce Downtime & Risk Tim Freeman Software Development Manager AWS Elastic Beanstalk D E V 3 3 0 Kam Mahant Software Development Manager AWS Elastic Beanstalk
  2. 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What the session will cover • Introduction to AWS Elastic Beanstalk • Overview of AWS Elastic Beanstalk deployment options • Focus on Blue-Green deployments • Q&A
  3. 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Running web applications on AWS AWS has multiple services that enable you to run your application including: However, this leaves the selection, provisioning, configuration, deployment, and management up to you • EC2, Lambda, ECS, EKS, Lightsail, FargateCompute • S3, EFSStorage • CLB, ALB, NLB, Security Groups, VPCNetwork • RDS, DynamoDB, AuroraDatabase • Auto Scaling, CloudFormation, Systems ManagerManagement Tools
  4. 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Elastic Beanstalk The easiest way to get your applications up and running in minutes Elastic Beanstalk is a managed service that automatically handles: • Infrastructure provisioning • Deployment • Load balancing configurations • Auto scaling configurations • Network and security configurations • Application level health monitoring • Application analysis and debugging tools There is no additional cost
  5. 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Platforms
  6. 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploying to production is hard • Deployment time • Downtime • Reduced capacity • Deployment failure • Rollback time • Cost
  7. 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Method Impact of failed deployment Deploy time Zero downtime Rollback process Code deployed to All at Once Downtime  X Re-deploy Existing instances Rolling Single batch of instance will be out of service. Any successfully deployed instances prior to failure will be running new application version   Re-deploy Existing instances Rolling with additional batch Minimum if first batch of instance fails, otherwise similar to Rolling   Re-deploy New & existing instances Immutable Minimal   Terminate new instances New instances Blue-Green (Achieved using two Environments) Minimal   Swap URL New instances Application deployment strategies
  8. 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 Deployment Option: All at once Deployment Scenarios • Fast rollout • Downtime tolerant
  9. 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Deployment Option: All at once
  10. 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V1 V2 V1 V2 V1 V2 V1 Deployment Option: All at once
  11. 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V2 V2 V2 Deployment Option: All at once
  12. 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Option: All at once Advantages Disadvantages
  13. 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Option: Rolling Deployment Scenarios
  14. 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Deployment Option: Rolling
  15. 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V1 V2 V1 Deployment Option: Rolling V1 V1
  16. 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V2 Deployment Option: Rolling V1 V1
  17. 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V1 V2 V1 Deployment Option: Rolling V2V2
  18. 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Rolling V2 V2 V2 V2
  19. 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Option: Rolling Advantages Disadvantages
  20. 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 Deployment Option: Rolling with additional batch Deployment Scenarios
  21. 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Rolling with additional batch V1 V1 V1 V1
  22. 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1V1 V1V2 V2 Deployment Option: Rolling with additional batch V1
  23. 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V2 Deployment Option: Rolling with additional batch V1V1 V1 V1
  24. 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V2 V1 V2 V1 Deployment Option: Rolling with additional batch V2 V2 V1V1
  25. 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Rolling with additional batch V2 V2 V1V1V2 V2
  26. 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Rolling with additional batch V2 V2 V2 V2 V1V1
  27. 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Rolling with additional batch V2 V2 V2 V2
  28. 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Option: Rolling with additional batch Advantages Disadvantages
  29. 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 Deployment Option: Immutable Deployment Scenarios
  30. 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Immutable V1 V1 V1 V1
  31. 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Temporary Auto Scaling Group V2 Deployment Option: Immutable
  32. 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Temporary Auto Scaling Group Deployment Option: Immutable V2
  33. 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Temporary Auto Scaling Group V2 V2 V2 Deployment Option: Immutable V2V1 V1 V1 V1
  34. 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Temporary Auto Scaling Group V2 V2 V2 Deployment Option: Immutable V2
  35. 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 V2 V2 V2 V2 Deployment Option: Immutable
  36. 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 V2 V2 V2 V2 Deployment Option: Immutable Auto Scaling Group
  37. 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Auto Scaling Group Elastic Beanstalk Environment myapp.us-east-1.elasticbeanstalk.com Deployment Option: Immutable V2 V2 V2 V2
  38. 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Option: Immutable Advantages Disadvantages
  39. 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 V1 V1 V1 V1 Blue-Green Deployments Deployment Scenarios
  40. 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 V1 V1 V1 V1 Blue-Green Deployments myapp.us-east-1.elasticbeanstalk.com
  41. 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 V1 V1 V1 V1 myapp.us-east-1.elasticbeanstalk.com Blue-Green Deployments
  42. 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 V1 V1 V1 V1 myapp.us-east-1.elasticbeanstalk.com Blue-Green Deployments
  43. 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 V1 V1 V1 V1 V1 V1 V1 myapp.us-east-1.elasticbeanstalk.com Blue-Green Deployments
  44. 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk Environment Auto Scaling Group myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Blue-Green Step 1: Clone the active environment
  45. 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk Environment Auto Scaling Group myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 V1 V1 V1 V1 Elastic Beanstalk Environment Auto Scaling Group Myapp_test.us-east-1.elasticbeanstalk.com V1 V1 V1 Cloned environment Blue-Green Step 1: Clone the active environment V1
  46. 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk Environment Auto Scaling Group myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Elastic Beanstalk Environment Auto Scaling Group Myapp_test.us-east-1.elasticbeanstalk.com Cloned environment V2 V2 V2 Blue-Green Step 2: Deploy and test changes V2V1 V1 V1 V1
  47. 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk Environment Auto Scaling Group myapp.us-east-1.elasticbeanstalk.com V1 V1 V1 V1 Elastic Beanstalk Environment Auto Scaling Group Myapp_test.us-east-1.elasticbeanstalk.com Cloned environment V2 V2 V2V1 V1 V1 V1 V2 Blue-Green Step 3: Swap environment URL
  48. 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue-Green Step 3: Swap environment URL
  49. 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 Blue-Green Deployments Elastic Beanstalk Environment Auto Scaling Group myapp.us-east-1.elasticbeanstalk.com V2 V2 V2 V2
  50. 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. V1 Blue-Green Deployments Advantages Disadvantages
  51. 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Method Impact of failed deployment Deploy time Zero downtime Rollback process Code deployed to All at Once Downtime  X Re-deploy Existing instances Rolling Single batch of instance will be out of service. Any successfully deployed instances prior to failure will be running new application version   Re-deploy Existing instances Rolling with additional batch Minimum if first batch of instance fails, otherwise similar to Rolling   Re-deploy New & existing instances Immutable Minimal   Terminate new instances New instances Blue-Green (Achieved using two Environments) Minimal   Swap URL New instances Application deployment strategies
  52. 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Beanstalk deployment options
  53. 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Additional Resources https://aws.amazon.com/quickstart/architecture/blue-green-deployment/ https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html
  54. 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  55. 55. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Tim Freeman Software Development Manager AWS Elastic Beanstalk Kam Mahant Software Development Manager AWS Elastic Beanstalk
  56. 56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

×