Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Getting Started with Serverless Architectures

590 vues

Publié le

Serverless architectures let you build and deploy applications and services with infrastructure resources that require zero administration. In the past, you had to provision and scale servers to run your application code, install and operate distributed databases, and build and run custom software to handle API requests. Now, AWS provides a stack of scalable, fully-managed services that eliminates these operational complexities. In this session, you will learn about serverless architectures, their benefits, and the basics of the AWS’s serverless stack (e.g., AWS Lambda, Amazon API Gateway, and AWS Step Functions). You will also get practical tips and tricks, best practices, and architecture patterns that you can take back and implement immediately.

  • Soyez le premier à commenter

Getting Started with Serverless Architectures

  1. 1. P U B L I C S E C T O R S U M M I T B rus s els
  2. 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T GettingStarted withServerless Architectures Prakash Palanisamy Solutions Architect Amazon Web Services
  3. 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Agenda • Serverless Foundations • Serverless Architecture Patterns • Web Application • Automation • Stream Processing • Batch Processing
  4. 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  5. 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Whatis serverless? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure
  6. 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T AWS Lambda AWS Fargate Amazon API Gateway Amazon SNS Amazon SQS AWS Step Functions COMPUTE DATA STORES INTEGRATION Amazon Aurora Serverless Amazon S3 Amazon DynamoDB AWS AppSync
  7. 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Customers love serverless
  8. 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Serverless compute engine for containers Long-running Bring existing code Fully-managed orchestration AWS Fargate Let’s focus on compute for now Serverless event-driven code execution Short-lived All language runtimes Data source integrations AWS Lambda
  9. 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T SERVICES (ANYTHING) Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C# Go Ruby Serverless applications
  10. 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T 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
  11. 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Using AWS Lambda Bring your own code • Node.js, Java, Python, C#, Go, Ruby • Bring your own libraries (even native ones) Simple resource model • Select power rating from 128 MB to 3 GB • CPU and network allocated proportionately Authoring functions • WYSIWYG editor or upload packaged .zip • Third-party plugins (Eclipse, Visual Studio)
  12. 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Amazon S3 Amazon SNSAmazon SES Cron events DATA STORES ENDPOINTS DEVELOPMENT AND MANAGEMENT TOOLS EVENT/MESSAGE SERVICES Event sources that trigger AWS Lambda …and more! Amazon API Gateway Amazon Alexa AWS IoT AWS Step Functions Amazon DynamoDB Amazon Kinesis Amazon Cognito AWS CloudFormation AWS CloudTrail AWS CodeCommit Amazon CloudWatch
  13. 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Lambda Execution Model Synchronous (push) Asynchronous (event) Stream-based Amazon API Gateway AWS Lambda function Amazon DynamoDBAmazon SNS /order AWS Lambda function Amazon S3 reqs Amazon Kinesis changes AWS Lambda service function
  14. 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Making development easierwithAWS Lambda Trillions of executions every month for hundreds of thousands of active customers Accessible for all developers Enable new application patterns Greater productivity Support for all runtimes with Lambda Layers and Runtime API ISO, PCI, HIPAA, SOC, GDPR, and FedRamp compliances 15 minute functions SQS for Lambda Automatic Load Balancing for Lambda Support for Kinesis Data Streams Enhanced Fan-Out and HTTP/2 Toolkits for popular IDEs: VSCode, IntelliJ, and PyCharm Simplified deployment with nested apps
  15. 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T AWS Lambda permissions model Fine-grained security controls for both invocation and execution Function policies: • What can invoke the Lambda function Execution role: • What the Lambda function can access
  16. 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Basic Function Code 'use strict' exports.handler = function (event, context, callback) { console.log(“Event:”, JSON.stringify(event)) callback(null, ”Hello World!") } { “Records”:[ “s3”: { “object”:” { … } } ] } JSON Context
  17. 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Amazon API Gateway Create a unified API frontend for multiple microservices Authenticate and authorize requests to a backend DDoS protection and throttling for your backend Throttle, meter, and monetize API usage by third- party developers
  18. 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T APIGatewayIntegrations Internet Mobile apps Websites Services AWS Lambda functions AWS API Gateway Cache Endpoints on Amazon EC2 All publicly accessible endpoints Amazon CloudFront Any other AWS service Your VPC Endpoints in your VPC Regional API endpoints Amazon CloudWatch Monitoring
  19. 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T AWS Step Functions “Serverless” workflow management with zero administration: • Coordinates distributed applications using visual workflows • Automatically triggers, tracks, and logs each step
  20. 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Security and Identity • User pools for secure, managed user directories • Identity pools for federation and role-based access control Amazon Cognito • Fine-grained access control to AWS resources AWS Identity and Access Management
  21. 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Logging and Monitoring Amazon CloudWatch AWS X-Ray
  22. 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T AWS Serverless Application Model (SAM) • Extension of AWS CloudFormation • Automate deployment via AWS CodePipeline • Build, test, and debug locally via SAM CLI • Search and deploy serverless apps on the AWS Serverless Application Repository
  23. 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  24. 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Web applications • Static websites • Complex web apps • Packages for Flask and Express Data processing • Real-time • MapReduce • Batch Chatbots • Powering chatbot logic Backends • Apps and services • Mobile • IoT </></> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT automation • Policy engines • Extending AWS services • Infrastructure management Common serverless use cases
  25. 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Web application characteristics 1. Static and Dynamic Content 2. Microservices 3. Scalable 4. Authenticate and Authorize 5. Globally available
  26. 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Web application Browser Amazon CloudFront Microservices Amazon DynamoDB AWS LambdaAmazon API Gateway Amazon Cognito Amazon S3
  27. 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Bustle Achieves 84% Cost Savings with AWS Lambda Bustle is a news, entertainment, lifestyle, and fashion website targeted towards women. With AWS Lambda, we eliminate the need to worry about operations Tyler Love CTO, Bustle ” “ • Bustle had trouble scaling and maintaining high availability for its website without heavy management • Moved to serverless architecture using AWS Lambda and Amazon API Gateway • Experienced approximately 84% in cost savings • Engineers are now focused on innovation
  28. 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Multi-Region with API Gateway eu-central-1 eu-west-1 Client Amazon Route 53 Regional API Endpoint Regional API Endpoint Custom Domain Name Custom Domain Name API Gateway API Gateway Lambda Lambda
  29. 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Automation characteristics • Periodic jobs • Event triggered workflows • Enforce security policies • Audit and notification • Respond to alarms • Extend AWS functionality
  30. 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Enforce security policies RDP from 0.0.0.0/0 RDP from 0.0.0.0/0 CloudWatch Event Bus in another AWS Account New Security Group ingress rule Amazon CloudWatch Events: Rule AWS Lambda: Remediate and alert AWS SNS: Email alert Ingress rule deleted
  31. 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Autodesk - Tailor Serverless AWS Account Provisioning and Management Service: • Automates AWS Account creation, • Configures AWS IAM, AWS CloudTrail, AWS Config, AWS Direct Connect, and Amazon VPC • Enforces corporate standards • Audit for compliance Provisions new Accounts in 10 minutes vs 10 hours in earlier manual process Open source and extensible: https://github.com/alanwill/aws-tailor
  32. 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T AWS Ops Automator Amazon CloudWatch: Time-based events AWS Lambda: Event handler AWS Lambda: Task executors AWS SNS: Error and warning notifications Resources in multiple AWS Regions and Accounts Amazon EC2 Tags OpsAutomatorTaskList CreateSnapshotAmazon DynamoDB: Task configuration & tracking Amazon CloudWatch: Logs Amazon Redshift https://aws.amazon.com/answers/infrastructure-management/ops-automator/
  33. 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Image recognition and processing Web App Amazon Cognito: User authentication Amazon S3: Image uploads Start state machine execution Extract image meta-data Amazon Rekognition: Object detection Invoke Amazon Rekognition Generate image thumbnail Amazon DynamoDB: Image meta-data & tags Store meta-data and tags https://github.com/awslabs/lambda-refarch-imagerecognition AWS Step Functions: Workflow orchestration Image recognition and processing
  34. 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Stream processing characteristics • High ingest rate • Near real-time processing (low latency from ingest to process) • Spiky traffic (lots of devices with intermittent network connections) • Message durability • Message ordering
  35. 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Amazon Kinesis AWS Lambda 1 Amazon CloudWatch Amazon DynamoDB AWS Lambda 2 Amazon S3 Real-time data processing: 1. Real-time event data sent to Amazon Kinesis allows multiple AWS Lambda functions to process the same events 2. In AWS Lambda, Function 1 processes and aggregates data from incoming events, then stores result data in Amazon DynamoDB 3. Lambda Function 1 also sends values to Amazon CloudWatch for simple monitoring of metrics 4. In AWS Lambda function, Function 2 does data manipulation of incoming events and stores results in Amazon S3 https://s3.amazonaws.com/awslambda-reference-architectures/stream-processing/lambda-refarch-streamprocessing.pdf AWS Lambda + Amazon Kinesis
  36. 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Sensor datacollection IoT rules IoT actions MQTT Amazon S3: Raw records Amazon Kinesis Firehose: Delivery stream Amazon S3: Batched records Amazon Kinesis Streams: Real-time stream AWS IoT: Data collection IoT Sensors Real-time analytics applications
  37. 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Batchprocessing AWS Lambda: Splitter Amazon S3 Object Amazon DynamoDB: Mapper Results AWS Lambda: Mappers …. …. AWS Lambda: Reducer Amazon S3 Results Analytics & Processing Amazon SQS
  38. 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. P U B L I C S E C TO R S U M M I T Fannie MaeServerlessFinancialModeling Financial Modeling is a Monte-Carlo simulation process to project future cash flows, which is used for managing the mortgage risk on daily basis: • Underwriting and valuation • Risk management • Financial reporting • Loss mitigation and loan removal • ~10 quadrillion (10𝑥1015 ) of cash flow projections each month in hundreds of economic scenarios. • One simulation run of ~ 20 million mortgages takes 1.4 hours, >4 times faster than the existing process.
  39. 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  40. 40. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Prakash Palanisamy pprakash
  41. 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T

×