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.

Developing Modern Applications in the Cloud

107 views

Published on

Developing Modern Applications in
the Cloud

  • Be the first to comment

  • Be the first to like this

Developing Modern Applications in the Cloud

  1. 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Developing Modern Applications in the Cloud M A P 0 0 1 STEVEN BRYEN | AWS TECHNICAL & DEVELOPER EVANGELISM | @steven_bryen sbryen@amazon.com
  2. 2. The new normal: companies are increasingly global and products are completely digital 47% of CEOs said they are being challenged by the board of directors to make progress in digital business Source: Gartner 79% of CIOs believe that digital business is making their IT organizations better prepared to change 67% of all business leaders believe that they must pick up the pace of digitalization to remain competitive
  3. 3. To maintain competitive advantage, digital businesses must innovate as rapidly as possible FeedbackIdeas Experiment Innovation Flywheel
  4. 4. Invention requires two things: the ability to try a lot of experiments, and not having to live with the collateral damage of failed experiments.“ Andy Jassy CEO, Amazon Web Services
  5. 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. OLD WORLD IT Employees at work Factories + supply chainSales channels Marketing analytics
  6. 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Employees at work Factories + supply chainSales channels Marketing analytics OLD WORLD IT NEW WORLD IT
  7. 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. NEW WORLD IT Employees at work Factories + supply chain IoT connected things Online marketing Continuous supply tracking Just in time production Online sales + delivery Social media
  8. 8. Personalization Customer tracking New channels direct to customer More things, more scale, rapid change New Needs
  9. 9. Modern application development creates competitive differentiation by enabling rapid innovation
  10. 10. AWS customers are pioneering modern applications
  11. 11. Capabilities of a modern application Secure Resilient Elastic Modular Automated Interoperable
  12. 12. Assess and prioritize, app by app Pick path to modernization Lift & shift: data center → EC2 Re-platform: VMs → containers Refactor: monolith → microservices Re-invent: host fleets → serverless Modern application development: a journey with many paths
  13. 13. Options Available Re-platform AWS Fargate Re-invent AWS Lambda Re-factor AWS Step Functions Re-Host Amazon EC2
  14. 14. migrated ~850 applications running in ~5000 containers to Fargate to reduce the undifferentiated heavy lifting that came with managing Kubernetes Re-platform AWS Fargate
  15. 15. created a serverless stock trade validation system in 3 months that improved processing times by 67% while reducing costs by 50% Re-invent AWS Lambda
  16. 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Modern application checklist £ Enable security and compliance across the entire app lifecycle £ Structure apps as collections of microservices £ Build with serverless technologies as much as possible £ Use code to model applications and infrastructure £ Rapidly release high-quality features with CI/CD £ Gain insights into application behavior with monitoring
  17. 17. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  18. 18. Enable security and compliance across the entire app lifecycle Securing the lifecycle addresses blind spots without slowing down innovation Authenticate Authorize Audit & Govern Validate Prevent unauthorized access with strong access control Implement role-based access control using flexible policies Evaluate app behavior & ensure compliance requirements are met Verify each step to ensure solutions work only as intended
  19. 19. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  20. 20. Structure apps as collections of microservices When the impact of change is small, release velocity can increase Monolithic application Does everything Shared release pipeline Rigid scaling High impact of change Hard to adopt new technologies Microservices Does one thing Independent deployments Independent scaling Small impact of change Choice of technology
  21. 21. Structure apps as collections of microservices When the impact of change is small, release velocity can increase Microservices Do one thing – Well
  22. 22. Structure apps as collections of microservices Properties of microservices Microservices • Independent • Individually Deployed & Scaled • Polyglot • Modular - Easily Replaced • Decentralized
  23. 23. Structure apps as collections of microservices Design Concepts • Use managed services • Focus on writing your business logic (not on maintaining infrastructure) • Loosely coupled & event driven • Simplify delivery and discovery AWS Lambda AWS Fargate
  24. 24. Structure apps as collections of microservices APIs and decoupled communications enable automation and improves reliability FUNCTION API API MICROSERVICE FUNCTION EVENT API MICROSERVICE EVENT API MICROSERVICE APPLICATION
  25. 25. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  26. 26. Databases in Modern Applications Relational Key-value DynamoDBAmazon RDS Aurora CommercialCommunity
  27. 27. Relational or not? NOT!
  28. 28. Common data categories and use cases Relational Referential integrity, ACID transactions, schema- on-write Lift and shift, ERP, CRM, finance Key-value High throughput, low- latency reads and writes, endless scale Real-time bidding, shopping cart, social, product catalog, customer preferences Document Store documents and quickly access querying on any attribute Content management, personalization, mobile In-memory Query by key with microsecond latency Leaderboards, real-time analytics, caching Graph Quickly and easily create and navigate relationships between data Fraud detection, social networking, recommendation engine Time-series Collect, store, and process data sequenced by time IoT applications, event tracking Ledger Complete, immutable, and verifiable history of all changes to application data Systems of record, supply chain, health care, registrations, financial
  29. 29. Purpose-built databases Relational Key-value Document In-memory Graph Time-series Ledger DynamoDB NeptuneAmazon RDS Aurora CommercialCommunity Timestream QuantumElastiCache DocumentDB
  30. 30. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  31. 31. Build with serverless technologies as much as possible Automation and abstraction frees you No infrastructure to provision or manage Automatically scales by unit of consumption Pay for value billing model Highly available and durable
  32. 32. Build with serverless technologies as much as possible Choice of compute is core to the transformation Serverless Containers Long-running Abstracts the OS Fully-managed orchestration Fully-managed cluster scaling AWS Fargate Serverless Functions Event-driven Many language runtimes Data source integrations No server management AWS Lambda
  33. 33. Build with serverless technologies as much as possible AWS container services landscape Management Deployment, Scheduling, Scaling & Management of containerized applications Hosting Where the containers run Amazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Amazon EC2 AWS Fargate Image Registry Container Image Repository Amazon Elastic Container Registry
  34. 34. Build with serverless technologies as much as possible Choice of compute is core to the transformation Serverless Containers Long-running Abstracts the OS Fully-managed orchestration Fully-managed cluster scaling AWS Fargate Serverless Functions Event-driven Many language runtimes Data source integrations No server management AWS Lambda
  35. 35. Build with serverless technologies as much as possible 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
  36. 36. Build with serverless technologies as much as possible Serverless architectures provide the greatest agility with the least effort Focus on creating business value Remove heavy lifting with serverless everything CUSTOMER AWS Messaging & Orchestration Compute Physical Infrastructure API Business logic Storage & Databases
  37. 37. Build with serverless technologies as much as possible Amazon API Gateway Fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale • Native AWS Service Integration • Stage and version management • API Authentication • WebSockets support
  38. 38. Build with serverless technologies as much as possible Coordinating multiple services with workflows increases agility, productivity and flexibility Track status of data and execution Remove redundant code
  39. 39. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  40. 40. Use code to model applications and infrastructure Treating everything as software increases the speed and agility of infrastructure deployments Design Write application code Create infrastructure templates Create stacks Iterate
  41. 41. Use code to model applications and infrastructure Infrastructure as code Declarative I tell you what I need I tell you what to do Imperative
  42. 42. Use code to model applications and infrastructure Infrastructure as code goals 1. Make infrastructure changes repeatable and predictable 2. Release infrastructure changes using the same tools as code changes 3. Replicate production environment in a staging environment to enable continuous testing
  43. 43. Use code to model applications and infrastructure Model function environments with AWS Serverless Application Model (SAM) • Open source framework for building serverless applications on AWS • Shorthand syntax to express functions, APIs, databases, and event source mappings • Transforms and expands SAM syntax into AWS CloudFormation syntax on deployment • Supports all AWS CloudFormation resource types https://aws.amazon.com/serverless/sam/
  44. 44. Use code to model applications and infrastructure SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetFunction: Type: AWS::Serverless::Function Properties: Handler: index.get Runtime: nodejs8.10 CodeUri: src/ Policies: - DynamoDBReadPolicy: TableName: !Ref MyTable Events: GetResource: Type: Api Properties: Path: /resource/{resourceId} Method: get MyTable: Type: AWS::Serverless::SimpleTable Just 20 lines to create: • Lambda function • IAM role • API Gateway • DynamoDB table
  45. 45. Use code to model applications and infrastructure Use SAM CLI to package and deploy SAM templates pip install --user aws-sam-cli sam logs sam validate sam local sam init sam build (--use-container) sam package sam deploy sam publish New
  46. 46. Use code to model applications and infrastructure Nested apps to simplify solving recurring problems Standard Component TweetSource: Type: AWS::Serverless::Application Properties: Location: ApplicationId: arn:aws:serverlessrepo:... SemanticVersion: 2.0.0 Parameters: TweetProcessorFunctionName: !Ref MyFunction SearchText: '#serverless -filter:nativeretweets’ Custom Business Logic
  47. 47. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  48. 48. Rapidly release high-quality features with CI/CD Teams that practice CI/CD ship more code faster, and with more confidence Source: Puppet 2017 State of DevOps Report 5x Lower change failure rate 440x Faster from commit to deploy 46x More frequent deployments 44% More time spent on new features & code
  49. 49. Rapidly release high-quality features with CI/CD Monolith development lifecycle monitorreleasetestbuild developers delivery pipelines services
  50. 50. ??? developers delivery pipelines services Rapidly release high-quality features with CI/CD Monolith development lifecycle
  51. 51. developers services monitorreleasetestbuild delivery pipelines monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild monitorreleasetestbuild Rapidly release high-quality features with CI/CD Monolith development lifecycle
  52. 52. Rapidly release high-quality features with CI/CD AWS CodeDeploy • Automates code deployments to any instance and Lambda • Handles the complexity of updating your applications • Avoid downtime during application deployment • Roll back automatically if failure detected • Deploy to Amazon EC2, Lambda, or on-premises servers
  53. 53. Rapidly release high-quality features with CI/CD CodeDeploy-Lambda deployments • Shifts traffic using Lambda function weighted aliases • Choose canary (“shift 10% of traffic for 10 minutes, then shift rest”) or linear (“shift 10% more traffic every 10 minutes”) • Validation “hooks” enable testing at each stage of the deployment • Fast rollback in seconds if case of hook failure or CloudWatch alarms • Monitor deployment status and history via console, API, Amazon Simple Notification Service (Amazon SNS) notifications, and CloudWatch Events
  54. 54. Rapidly release high-quality features with CI/CD CodeDeploy – Lambda deployments Enable in your serverless application template Resources: GetFunction: Type: AWS::Serverless::Function Properties: DeploymentPreference: Type: Canary10Percent10Minutes Alarms: - !Ref ErrorsAlarm Hooks: PreTraffic: !Ref PreTrafficHook Canary10Percent30Minutes Canary10Percent5Minutes Canary10Percent10Minutes Canary10Percent15Minutes Linear10PercentEvery10Minutes Linear10PercentEvery1Minute Linear10PercentEvery2Minutes Linear10PercentEvery3Minutes AllAtOnce
  55. 55. Rapidly release high-quality features with CI/CD CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 Lambda function code 100%
  56. 56. Rapidly release high-quality features with CI/CD CodeDeploy – Lambda canary deployment API Gateway Lambda function weighted alias “live” v1 code100% Run PreTraffic hook against v2 code before it receives traffic v2 code0%
  57. 57. API Gateway Lambda function weighted alias “live” v1 code90% Wait for 10 minutes, roll back in case of alarm v2 code10% Rapidly release high-quality features with CI/CD CodeDeploy – Lambda canary deployment
  58. 58. API Gateway Lambda function weighted alias “live” v1 code0% Run PostTraffic hook and complete deployment v2 code100% Rapidly release high-quality features with CI/CD CodeDeploy – Lambda canary deployment
  59. 59. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  60. 60. Use monitoring to optimize end user experience The faster you identify issues, the faster they can be resolved Metrics, logs and traces Monitoring, debugging and alerts Resource and application visibility Real-time insights MONITORING OBSERVABILITY
  61. 61. X-Ray Service
  62. 62. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  63. 63. Benefits of using AWS X-Ray with Lambda • X-Ray agent is natively built into Lambda. • Identify initialization and cold starts in Lambda • Pinpoint issues in downstream services called from your AWS Lambda function. • Happens with low latency in real-time. Can see traces in seconds.
  64. 64. Visualize Service Call Graph (Lambda)
  65. 65. Identify initialization & cold starts (Lambda)
  66. 66. Pinpoint errors (Lambda)
  67. 67. Keeps track of all your application components, their locations, attributes, and health status. • Define convenient names for all cloud resources • Discover resources with specific attributes • Ensure only healthy resources are discovered • Use highly available DNS and Regional API. New: AWS Cloud Map
  68. 68. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T So how do we build modern apps? £ Build security and compliance into the entire app lifecycle £ Structure apps as collections of microservices £ Build with serverless technologies as much as possible £ Use code to model applications and infrastructure £ Rapidly release high-quality features with CI/CD £ Gain insights into application behavior with monitoring
  69. 69. Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. STEVEN BRYEN | AWS TECHNICAL & DEVELOPER EVANGELISM | @steven_bryen sbryen@amazon.com
  70. 70. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I TS U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

×