O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Building Modern Applications on AWS

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio

Confira estes a seguir

1 de 62 Anúncio

Mais Conteúdo rRelacionado

Diapositivos para si (20)

Semelhante a Building Modern Applications on AWS (20)

Anúncio

Mais recentes (20)

Building Modern Applications on AWS

  1. 1. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Building Modern Applications on AWS Injae Kwak, Solutions Architect Phong Le, Solutions Architect Bikram Bora, Solutions Architect
  2. 2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Agenda 9:00am - Opening and Housekeeping 9:15am - Unlocking Business Values with Modern Application Development 9:35am - Customer Case Study 10:00am - Intro to Docker, Container Ecosystem and Serverless on AWS 10:20am - Morning Tea/Break time 10:40am - Hands-on Lab 12:00pm - Lunch 1:00pm - Hands on Lab (continued) 4:00pm – End of Workshop
  3. 3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Modern Applications Injae Kwak, Solutions Architect injakwak@amazon.com Unlocking Business Values with Modern Application Development
  4. 4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Mobility – Access to applications, devices and data needs to be accessible inside and outside the organisation Device boom – 100 million smart phones in 2007…today there are over 10 billion connected devices…30 billion by 2020 Hybrid cloud – Applications and data needs to span on-premises and cloud Data growth – Exponential data growth and more ability than ever to capture insights the yield competitive advantage Shift to microservices – The move from monoliths to highly decoupled applications that can span multiple applications and even organisations
  5. 5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  6. 6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark The Monolith “…a single-tiered software application in which the user interface and data access code are combined into a single program from a single platform. A monolithic application is self-contained, and independent from other computing applications.” - Wikipedia
  7. 7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Monolith = “Traditional” Applications • Applications developed to “best practices” and standards of the time • Monolith does not mean poorly designed • Applications didn’t need to be or weren’t designed to be distributed • Application design constrained by resources
  8. 8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Monolith = “Traditional” Applications Pros: • At first… o Simple o No over-engineering • In-process latencies • Single codebase • Resource efficient at small scale Cons: • Modularity is hard to enforce as app grows • Can only scale up! • All or nothing deployment • Increasing database dependencies • Long release cycles • Slow to react to customer demand
  9. 9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark 2001+Prior 2001 Development transformation at Amazon: 2001+ monolithic application + teams microservices + 2 pizza teams
  10. 10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Monolith development lifecycle developers releasetestbuild delivery pipelineapp
  11. 11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Value Selection Convenience
  12. 12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  13. 13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Conway’s Law “…organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations…” — M. Conway
  14. 14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. > 60 million deployments a year* Thousands of teams × Microservice architecture × Continuous delivery × Multiple environments *2016 number
  15. 15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Single-purpose Connect only through APIs Connect over HTTPS Largely “black boxes” to each other
  16. 16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  17. 17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. So what is a microservice?
  18. 18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “…the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API…” - Martin Fowler
  19. 19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “Independently deployable services that work together, modelled around a business domain…” -Sam Newman
  20. 20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What microservices are… “The technical authority for a business capability” - Udi Dahan
  21. 21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Shipping Inventory Customer Service Accounts Returns Invoicing
  22. 22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservice development lifecycle developers delivery pipelinesservices releasetestbuild releasetestbuild releasetestbuild releasetestbuild releasetestbuild releasetestbuild
  23. 23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What does this look like? Admin UI Orders Service Inventory Service Shipping Service Admin UI Orders Service Inventory Service Shipping Service Customer UI Customer UI
  24. 24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Docker Lightweight container virtualization platform. Tools to manage and deploy your applications. Licensed under the Apache 2.0 license. Built by Docker, Inc.
  25. 25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What is a container? • A lightweight, stand-alone, executable package of software that includes all dependencies: code, runtime, system tools, system libraries, settings. • Containers isolate software from its surroundings • development and staging environments • help reduce conflicts between teams running different software on the same infrastructure. • Long history: chroot, FreeBSD Jails, Solaris Containers, OpenVZ, LXC • Docker simplified creation/management/operation of containers
  26. 26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. MICROSERVICES & CONTAINERS Portability Package application and dependencies in a single artifact Any language on any platform Speed to launch is milliseconds vs… Image is the version Stateless servers reduce change risk Admin UI Orders Service Inventory Service Shipping Service Customer UI
  27. 27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Benefits to the business? • React to customer demand at a much faster rate than before • Reduce the blast radius of failures allowing your customers to continue to use the application if small pieces are unavailable • Allow richer insights into how your users are interacting with your application as we start collecting usage data in each microservice that SHOULD map to business domains • Better resource utilization means a cheaper infrastructure bill
  28. 28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Final thoughts Not everyone needs Microservices. If you have a well defined domain then you don’t have to break the monolith apart entirely Don’t use a big bang approach. It’s an evolutionary journey. Consider a monolith-first approach. Identify your bounded contexts first and then decouple. Lead your microservices strategy from strategic perspective. Model your microservices around business capabilities and objectives.
  29. 29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you 
  30. 30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Case Study: Transition to Microservices on Amazon Web Services
  31. 31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Quick Overview • AgTech Industry. • Cloud-based commodity management platform. • Allows businesses to store, track and manage their: • Contracts • Deliveries • Prices • Orders • Consignments • Invoices
  32. 32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Existing Platform • Built initial platform on Microsoft Azure. • Cloud Native – utilizing Microsoft services. • Continuing to run existing infrastructure on Azure.
  33. 33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Drivers • Modern Application – “Monolithic” style. • Difficult to maintain / update / scale components. • Looking for increased scalability. • Removing technical debt. • Going global.
  34. 34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Getting Started • Planning is key! • Identified key domain areas and bounded contexts. • Each area would become responsible for processing and storing its own data. • Understood data flows / communication between services.
  35. 35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Cloud Providers • Bigger than just a monolith => microservices project. • Also changing Cloud Providers… • Talked to AWS and engaged a partner – Itoc – to assist in setting up the Foundational AWS environment and provide guidance and assistance during the transition to Microservices on AWS.
  36. 36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Technical Implementation • Identified core skills across the team and selected platforms & languages. • Desire across the team to avoid managing infrastructure & leverage AWS-native services. • Landed on Containerisation (i.e. Docker) and Serverless (Lambda).
  37. 37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Technical Implementation • Validated and tweaked reference microservices architecture with Itoc. • Automation and DevOps pipelines key to ensuring consistent and repeatable deployments.
  38. 38. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark A Few Learnings • Increased Agility – speed of turn around and implementation time. • Standardise your deployments. • Leave technical debt behind. Embrace the new!
  39. 39. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What’s Next? • Going Global – entering overseas markets. • Migration off existing platform into full microservices.
  40. 40. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Phong Le, Solutions Architect huu@amazon.com Modern Applications A crash course on Microservices, Docker, Containers and Serverless on AWS
  41. 41. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Agenda • Decomposing a Monolith into Microservices • Getting Started, Challenges and Tips & Tricks • Docker and Containers on AWS • What about Serverless?
  42. 42. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Or how do we start?
  43. 43. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Monolith to Microservices https://www.martinfowler.com/bliki/StranglerApplication.html
  44. 44. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Breaking out your very first microservice Break dependencies away from the Monolith Dependency of AuthN
  45. 45. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Challenges and Tips & Tricks Distributed Systems Tech Sprawl (RDD) Operational Support Challenges Tips DistributedTracing (X-Ray), Monitoring and Log Aggregation (CloudWatch) Enforce Minimum Standards and Architectural Patterns You build it, you own it (and you’re on call) Distributed Data Event Sourcing (Kappa Architecture) and CQRS
  46. 46. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark So how do we run our (micro) services?
  47. 47. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Pets Cattle Rabbits Microbes Physical Virtualisation Containerization Serverless Evolution Of Compute Tin VMs Docker Lambda
  48. 48. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Containers and Docker A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.1 1 https://www.docker.com/resources/what-container Server Operating System Docker Engine AppA AppB AppC AppD
  49. 49. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Docker Architecture Docker daemon manages images, containers, networks, and volumes Docker CLI communicates with Docker daemon through a REST API Sample commands: docker build – build image from Dockerfile docker images – list images on Docker host docker run – run an image docker ps – list running containers docker stop – stop a running container Docker daemon / REST API Docker Host Container 1 Container 2 Container n Ubuntu Image Nginx Image Custom Image Docker Client Docker Registry Docker Hub
  50. 50. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Docker Image Read-only template Used to launch container Start with base image, additional data or dependencies added as layers Union file system merges layers into single image Instructions documented in Dockerfile kernel Base Image Image layer Image layer Image layer References parent image layer
  51. 51. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Dockerfile FROM dockerfile/ubuntu RUN add-apt-repository -y ppa:nginx/stable && apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* && echo "ndaemon off;" >> /etc/nginx/nginx.conf && chown -R www-data:www-data /var/lib/nginx VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] WORKDIR /etc/nginx CMD ["nginx"] EXPOSE 80 Pull base image Install Nginx Define mountable directories Define working directory Define default command Expose ports yourimage:1.0.0 9c9e81692ae9 02071fceb21b b35224abf821 fbc63d321d73 8c2e06607696 E7829950cee3
  52. 52. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Containers Ecosystem on AWS Amazon Elastic Container Service AWS Fargate Amazon EC2 Container Registry Amazon Elastic Container Service for Kubernetes Container Orchestration Services Container Registry Kops Rancher Docker Hub
  53. 53. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Combine best of containers and serverless
  54. 54. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Closing thoughts • Microservices can come with its own challenges • Containers are a great stepping stone to get started • Think about your customer first and work backwards
  55. 55. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Questions? Survey Link: http://bit.ly/2KrZNEL
  56. 56. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Hands-on Lab www.mythicalmysfits.com
  57. 57. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Our mission: Ethical, mythical creature care. Our priority: Find homes for the abandoned, and often misunderstood, mythical creatures in our community. Help us find their forever homes! Your mission: Modernize and innovate on the Mythical stack. Lab 1: Containerize the monolithic application Lab 2: Deploy containers using AWS Fargate Lab 3: Scale and lay the foundation for microservices with an AWS Application Load Balancer (ALB) Lab 4: Our developers completed Project Cuddle which adds a “like” feature to the application. Since we want to move to a microservices design, help us break this functionality from the monolith and deploy it with AWS Fargate as its own containerized microservice. Welcome to Mythical Mysfits
  58. 58. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lab 1: Build/Test Monolith Docker Image VPC AWS Cloud Public subnet Private subnet users
  59. 59. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lab 2: Deploy with Fargate VPC AWS Cloud Public subnet Private subnet users
  60. 60. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lab 3: Scale with ALB VPC AWS Cloud Private subnet Private subnet users /
  61. 61. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lab 4: Deploy ”Like” Microservice VPC AWS Cloud Private subnet Private subnet users / + /fulfill-like /like /fulfill-like /fulfill-like
  62. 62. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Instructions: http://www.mythicalmysfits.com/fargate Raise your hand if you have any questions. Feel free to work together with folks at your table/chairs. Near the end, we’ll hand out AWS credit codes to cover costs for the workshop. High-five your neighbors and have fun! Please fill out feedback forms and follow the clean-up instructions once you are done! Email us with comments/questions/feedback/AWS Account Credit: injakwak@amazon.com aws-mythical-mysfits@amazon.com Logistics

×