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.

Building Microservices with Containers (CON308-R1) - AWS re:Invent 2018

871 views

Published on

Microservices are minimal function services that are deployed separately, but can interact together to function as a broader application. Microservices can be built, changed, and deployed quickly with a relatively small impact, empowering developers to speed up the rate of innovation. In this session, we show how containers help enable microservices-based application architectures, discuss best practices for building new microservices, and cover the AWS services that allow you to build performant microservices applications.

  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y3nhqquc } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • https://www.youtube.com/watch?v=sTSkRB-s6V8
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Building Microservices with Containers (CON308-R1) - AWS re:Invent 2018

  1. 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building Microservices with Containers Arun Gupta (@arungupta) Principal Open Source Technologist Amazon Web Services C O N 3 0 8 R Sarah Wells (@sarahjwells) Technical Director for Operations and Reliability Financial Times
  2. 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  3. 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Development transformation at Amazon: 2001–2009 monolithic application + teams 2001 Lesson learned: decompose for agility 2009 microservices + 2 pizza teams
  4. 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Full ownership Full accountability “DevOps” Focused innovation Two-pizza teams
  5. 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  6. 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What changes have to be made in this new world? Architectural patterns Operational model Software delivery
  7. 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  8. 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monoliths are good, but they have some limitations Coordination overhead Poor modularity - No DRY High impact of change Poor scalability Long build time
  9. 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. When the impact of change is small, release velocity can increase Monolith Does everything Microservices Does one thing
  10. 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. MICROSERVICE API API MICROSERVICE MICROSERVICE EVENT API MICROSERVICE EVENT API MICROSERVICE APPLICATION Mobile client Client IoT PERSISTENCE PERSISTENCE
  11. 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Manage APIs with API Gateway Mobile apps Websites Services Internet Amazon CloudFront Amazon CloudWatch monitoring API Gateway cache Any other AWS service All publicly accessible endpoints AWS Lambda functions Endpoints in your VPC Regional API Endpoints AWS Lambda functions Endpoints on Amazon EC2 Your VPCAWS
  12. 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event-driven architectures
  13. 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Decouple state from code using messaging Queues Simple Fully-managed Any volume Pub/sub Simple Fully-managed Flexible Amazon Simple Queue Service Amazon Simple Notification Service Messaging Synchronization Rapid Fully-managed Real-time Amazon CloudWatch Events
  14. 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Track status of data and execution Remove redundant code Build workflows to orchestrate everything
  15. 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Services for Containerized Microservices Storage & Database Amazon DynamoDB Amazon ElastiCache Amazon Relational Database Service (Amazon RDS) Amazon Simple Storage Service (Amazon S3) Logging & Monitoring Amazon CloudWatch AWS CloudTrail AWS X-Ray Application Integration Amazon MQ Amazon Simple Notification Service (Amazon SNS) Amazon Simple Queue Service (Amazon SQS) AWS Step Functions Developer Tools AWS CodeBuild AWS CodePipeline AWS Cloud9 Networking & API Proxy Amazon API Gateway Elastic Load Balancing Amazon Route 53 Compute Amazon EKS Amazon ECS Amazon ECR Fargate AWS Elastic Beanstalk
  16. 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Eight reasons why Amazon uses microservices Pick the right tool for the job Create new compositions easily Improve resilience and security Experiment and fail safely Lower costs with granular scaling Adopt technology faster Optimize team productivity Deploy features safely and quickly
  17. 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  18. 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS operational responsibility models On-Premises Cloud Less More Compute Virtual Machine EC2 Elastic Beanstalk AWS LambdaFargate Databases MySQL MySQL on EC2 RDS MySQL RDS Aurora Aurora Serverless DynamoDB Storage Storage S3 Messaging ESBs Amazon MQ Kinesis SQS / SNS Analytics Hadoop Hadoop on EC2 EMR Elasticsearch Service Athena
  19. 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Comparison of operational responsibility AWS Lambda Serverless functions AWS Fargate Serverless containers ECS/EKS Container-management as a service EC2 Infrastructure-as-a-Service More opinionated Less opinionated AWS manages Customer manages • Data source integrations • Physical hardware, software, networking, and facilities • Provisioning • Application code • Container orchestration, provisioning • Cluster scaling • Physical hardware, host OS/kernel, networking, and facilities • Application code • Data source integrations • Security config and updates, network config, management tasks • Container orchestration control plane • Physical hardware software, networking, and facilities • Application code • Data source integrations • Work clusters • Security config and updates, network config, firewall, management tasks • Physical hardware software, networking, and facilities • Application code • Data source integrations • Scaling • Security config and updates, network config, management tasks • Provisioning, managing scaling and patching of servers
  20. 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Containers and Microservices • Do one thing, really well • Any app, any language • Test and deploy same artifact • Self-contained services • Isolated execution environment • Faster startup • Scaling and upgrading Container Container Container Container
  21. 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do we monitor and control all of these microservices?
  22. 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting logic inside each microservice is complex Microservice Application Code
  23. 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Easier: decouple operational logic and SDKs Application CodeMicroservice Proxy Logic for: Monitoring Routing Discovery Deployment
  24. 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Observability and Traffic Control • Identify root causes and bottlenecks using monitoring and tracing • Simplified blue/green using client-side traffic shaping • Retries and circuit breaker using failure routing • Work across cluster and container services • Avoid “framework explosion” across multiple languages
  25. 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Web Shopping Cart Notifications Inventory Inventory
  26. 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  27. 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The fast companies are 2555x faster than the slow Compared to low performers, high performers have: 46x more frequent code deployments 2555x faster lead time from commit to deploy 2604x faster mean time to recover from downtime 7.0x lower change failure rate DevOps - Time to Value
  28. 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Monolith development lifecycle monitorreleasetestbuild developers delivery pipelines services
  29. 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Microservice development lifecycle developers services monitorreleasetestbuild delivery pipelines monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild
  30. 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How Amazon does DevOps (microservices, 2 pizza teams) (governance, templates)
  31. 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Moved their large monolithic application to a microservices- based architecture Their time to deploy software changes went from hours to minutes AWS case studies—containerized microservices Built their Arc publishing platform as containerized microservices running on AWS It supports over 100 microservices composed of more than 3,000 containers Built and launched their Home Delivery platform in less than 4 months using a microservices architecture, scaling to 20,000 orders per second
  32. 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Adopting microservices at the Financial Times Sarah Wells, Technical Director for Operations & Reliability
  33. 33. The FT’s Content Platform
  34. 34. @sarahjwells #reInvent Step 1: monolith to microservices
  35. 35. Context First microservices case studies: March 2012 Martin Fowler/James Lewis blog post: March 2014 Sam Newman book: February 2015
  36. 36. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: September - first code committed
  37. 37. @sarahjwells #reInvent Conditions for change
  38. 38. @sarahjwells #reInvent If you’re going to do things lots of times, you need to be able to do them quickly
  39. 39. https://xkcd.com/1205/
  40. 40. @sarahjwells #reInvent Provisioning a server
  41. 41. Provisioning time in 2011
  42. 42. @sarahjwells #reInvent Self service via FT Platform
  43. 43. Context FT Platform on private cloud: early 2012 FT Platform on AWS: September 2014
  44. 44. Provisioning time in 2014
  45. 45. @sarahjwells #reInvent Don’t start with microservices until you can provision a server in minutes
  46. 46. @sarahjwells #reInvent Automated deployment
  47. 47. @sarahjwells #reInvent Zero downtime deployments
  48. 48. @sarahjwells #reInvent Setting up new deployment pipelines has to be quick
  49. 49. @sarahjwells #reInvent Our old build and release process was very manual
  50. 50. @sarahjwells #reInvent 12 releases a year
  51. 51. @sarahjwells #reInvent New deployment pipelines based on Jenkins and Puppet
  52. 52. @sarahjwells #reInvent If you can’t deploy the smallest possible change to production in under an hour, fix that first
  53. 53. @sarahjwells #reInvent Continuous delivery will force you to change your culture
  54. 54. @sarahjwells #reInvent No more change approval boards
  55. 55. @sarahjwells #reInvent Moving to microservices
  56. 56. @sarahjwells #reInvent Single responsibility
  57. 57. @sarahjwells #reInvent Asychronous communication via queue is essential
  58. 58. @sarahjwells #reInvent Polyglot persistence
  59. 59. @sarahjwells #reInvent What we gained
  60. 60. @sarahjwells #reInvent Small = easy to understand
  61. 61. @sarahjwells #reInvent Clear boundaries = easy to test the component
  62. 62. @sarahjwells #reInvent Releases are small and self contained = easy to understand what the change is
  63. 63. @sarahjwells #reInvent Moved from 12 to > 2000 deployments a year
  64. 64. @sarahjwells #reInvent Much lower failure rate - less than 1% vs over 15%
  65. 65. @sarahjwells #reInvent Decreasing the time to get new features out is THE reason to do microservices
  66. 66. @sarahjwells #reInvent Challenges
  67. 67. @sarahjwells #reInvent Getting the right level of granularity
  68. 68. @sarahjwells #reInvent Be prepared to combine or split services
  69. 69. @sarahjwells #reInvent Eventual consistency / data in many places
  70. 70. @sarahjwells #reInvent The development flow is different
  71. 71. @sarahjwells #reInvent Repeating yourself can be a good idea
  72. 72. @sarahjwells #reInvent Be lenient in what you accept: ignore fields you don’t need
  73. 73. @sarahjwells #reInvent Operational complexity
  74. 74. @sarahjwells #reInvent Devops is essential
  75. 75. @sarahjwells #reInvent ‘Grey’ failure is the norm
  76. 76. @sarahjwells #reInvent 150 services, 2 instances in each region 5 checks Every minute
  77. 77. @sarahjwells #reInvent -> over 4 million checks a day
  78. 78. @sarahjwells #reInvent Lots of these failures are things you don’t care about
  79. 79. @sarahjwells #reInvent Focus on things you’d want someone to call you about at 2 am
  80. 80. @sarahjwells #reInvent Log aggregation
  81. 81. @sarahjwells #reInvent Tracing
  82. 82. Transaction ids are essential
  83. 83. @sarahjwells #reInvent Microservices can be expensive to run
  84. 84. @sarahjwells #reInvent Any manual change has to be done many times
  85. 85. @sarahjwells #reInvent Automation and abstraction will save you
  86. 86. @sarahjwells #reInvent Step 2: the move to containers
  87. 87. Context Docker released: March 2013 Docker 1.0: October 2014
  88. 88. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: Start looking at containers
  89. 89. @sarahjwells #reInvent Spend your innovation tokens wisely http://mcfunley.com/choose-boring-technology
  90. 90. @sarahjwells #reInvent In 2014, writing our own cluster orchestration was an innovation token we were willing to spend
  91. 91. @sarahjwells #reInvent CoreOS on EC2 + docker + our own services
  92. 92. @sarahjwells #reInvent Cluster management through fleet and systemd
  93. 93. @sarahjwells #reInvent Routing via vulcand and etcd
  94. 94. Systemd service files
  95. 95. Deployment via custom go ‘deployer’ microservice
  96. 96. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: Running docker in production
  97. 97. @sarahjwells #reInvent What we gained
  98. 98. @sarahjwells #reInvent ~40% reduction in AWS costs
  99. 99. @sarahjwells #reInvent Many fewer steps to start running a new service in production
  100. 100. @sarahjwells #reInvent Development, staging and production are the same
  101. 101. @sarahjwells #reInvent Challenges
  102. 102. @sarahjwells #reInvent Supportability of an in-house platform is a challenge
  103. 103. @sarahjwells #reInvent Technical debt
  104. 104. @sarahjwells #reInvent - routing complex and error prone
  105. 105. @sarahjwells #reInvent - limited rebalancing of services, limited self healing
  106. 106. @sarahjwells #reInvent By late 2016, tools were maturing
  107. 107. @sarahjwells #reInvent Choose boring technology http://mcfunley.com/choose-boring-technology
  108. 108. @sarahjwells #reInvent Using leading edge technologies requires you to be comfortable with change
  109. 109. @sarahjwells #reInvent Don’t be (too) scared about making the wrong decision http://uk.businessinsider.com/jeff-bezos-on-type-1-and- type-2-decisions-2016-4
  110. 110. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: Evaluate cluster orchestration options
  111. 111. @sarahjwells #reInvent Step 3: migrating to kubernetes
  112. 112. Context First kubernetes release: June 2014 Kubernetes 1.6 release: March 2017 Github migrate to kubernetes: August 2017
  113. 113. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: Start migrating to kubernetes
  114. 114. @sarahjwells #reInvent Kubernetes solved our biggest issues
  115. 115. @sarahjwells #reInvent Kubernetes assigns names to every service - routing is simpler and less error prone
  116. 116. @sarahjwells #reInvent Kubernetes is self healing - unhealthy instances get restarted
  117. 117. @sarahjwells #reInvent Kubernetes will move services around
  118. 118. @sarahjwells #reInvent Deployments
  119. 119. @sarahjwells #reInvent We migrated from systemd service files to Helm charts
  120. 120. @sarahjwells #reInvent Integrating the service into a templated Jenkins pipeline
  121. 121. @sarahjwells #reInvent 2013: 2014: 2015: 2016: 2017: 2018: Live on Kubernetes
  122. 122. @sarahjwells #reInvent Moving to a new platform takes time and requires investment
  123. 123. @sarahjwells #reInvent What we gained
  124. 124. @sarahjwells #reInvent Stability
  125. 125. @sarahjwells #reInvent Supportability
  126. 126. @sarahjwells #reInvent Challenges
  127. 127. @sarahjwells #reInvent We still have a platform to maintain
  128. 128. @sarahjwells #reInvent Now what?
  129. 129. @sarahjwells #reInvent Containers are here to stay
  130. 130. @sarahjwells #reInvent Kubernetes vs ECS vs Elastic Beanstalk
  131. 131. @sarahjwells #reInvent Building a container deployment platform
  132. 132. @sarahjwells #reInvent Making it someone else’s problem?
  133. 133. @sarahjwells #reInvent Get comfortable with change
  134. 134. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Arun Gupta (@arungupta) Principal Open Source Technologist Amazon Web Services Sarah Wells (@sarahjwells) Technical Director for Operations and Reliability Financial Times
  135. 135. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

×