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 - August 2016 Monthly Webinar Series

1 984 vues

Publié le

Serverless architectures allow you to build and run applications and services without having to manage infrastructure. With serverless architectures, your application still runs on servers, but all the server management is done by AWS .

In this webinar, you will learn how to build applications and services using a serverless architecture. We will discuss how you can use AWS Lambda to run code for any type of application or backend service; use Amazon DynamoDB to store application data with high scalability and redundancy; and use Amazon API Gateway to create and manage secure API endpoints. We will run through a demo setting up a web application using this architecture, and we will discuss best practices and patterns used by our customers to run serverless applications.

Learning Objectives:
• Understand the basics of serverless architectures
• Learn how to use Lambda, API Gateway, and DynamoDB to run web applications

Publié dans : Technologie

Getting Started with Serverless Architectures - August 2016 Monthly Webinar Series

  1. 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Andrew Baird, Solutions Architect, AWS August 24, 2016 Getting Started with Serverless Architectures
  2. 2. Agenda  Background  AWS Lambda  Amazon API Gateway  Demo  Serverless Architecture Patterns  Serverless Best Practices
  3. 3. Background How serverless architecture patterns with AWS Lambda are the next evolution of application design
  4. 4. The Monolithic Architecture
  5. 5. The Service Oriented Architecture Presentation Tier Logic Tier Data Tier
  6. 6. The Microservices Architecture
  7. 7. Tools to help this pattern are VAST  Web Servers  Code Libraries  Web Service/Application Frameworks  Configuration Management Tools  API Management Platforms  Deployment Patterns  CI/CD Patterns  Containers  Etc. Etc. Etc.
  8. 8. AWS has helped too!  Amazon EC2  EC2 Auto-Scaling  AWS Elastic Load Balancer  EC2 Auto-Recovery  AWS Trusted Advisor  AWS Elastic Beanstalk  AWS OpsWorks  AWS EC2 Container Service  Etc. Etc. Etc.
  9. 9. But…. many of these tools and innovations are still coupled to a shared dependency…
  10. 10. Servers (AAHHHHHHHHH!!)  What size servers are right for my budget?  How many users create too much load for my servers?  How much remaining capacity do my servers have?  How can I detect if a server has been compromised?  How many servers should I budget for?  Which OS should my servers run?  Which users should have access to my servers?  How can I control access from my servers?  How will I keep my server OS patched?  How will new code be deployed to my servers?  How can I increase utilization of my servers?  When should I decide to scale out my servers?  What size server is right for my performance?  Should I tune OS settings to optimize my application?  Which packages should be baked into my server images?  When should I decide to scale up my servers?  How should I handle server configuration changes?  How will the application handle server hardware failure?
  11. 11. Architect to be Serverless Fully Managed  No provisioning  Zero administration  High availability Developer Productivity  Focus on the code that matters  Innovate rapidly  Reduce time to market Continuous Scaling  Automatically  Scale up and scale down
  12. 12. AWS Lambda
  13. 13. Serverless, event-driven compute service Lambda = microservice without servers
  14. 14. Components of Lambda  A Lambda Function (that you write)  An Event Source  The AWS Lambda Service  The Function Networking Environment
  15. 15. The Lambda Function  Your Code (Java, NodeJS, Python)  The IAM role that code assumes during execution  The amount of memory allocated to your code (affects CPU and Network as well) A valid, complete Lambda function
  16. 16. An Event Source  When should your function execute?  Many AWS services can be an event source today: • S3 • Kinesis • SNS • DynamoDB • CloudWatch • Config Rules • Amazon Echo • Etc. • …and Amazon API Gateway (more later)
  17. 17. The AWS Lambda Service  Runs your function code without you managing or scaling servers.  Provides an API to trigger the execution of your function.  Ensures function is executed when triggered, in parallel, regardless of scale.  Provides additional capabilities for your function (logging, monitoring).
  18. 18. The Function Networking Environment Default - a default network environment within VPC is provided for you  Access to the internet always permitted to your function  No access to VPC-deployed assets Customer VPC - Your function executes within the context of your own VPC.  Privately communicate with other resources within your VPC.  Familiar configuration and behavior with: – Subnets – Elastic Network Interfaces (ENIs) – EC2 Security Groups – VPC Route Tables – NAT Gateway
  19. 19. “Hold on…” – you (maybe)
  20. 20. Lots of existing ways to abstract away servers  SaaS  PaaS  MBaaS  *aaS  Application Engines/Platforms
  21. 21. What’s unique about Lambda?  Abstraction at the code/function level (arbitrary, flexible, familiar)  The security model (IAM, VPC)  The pricing model  The community  Integration with the AWS Service ecosystem! • Scale • Triggers
  22. 22. Many Serverless Options on AWS Storage DatabaseNetwork Compute Content DeliveryMessaging and QueuesSecurity Gateways User Management Monitoring & Logging Internet of Things Machine Learning Streaming Analytics
  23. 23. Example Serverless Architecture
  24. 24. PlayOn! Sports – Video stream processing Laptop Encoders HLS S3 Playback VOD Stream mobile client CloudFro nt Streaming Live stream mobile client CloudFro nt S3 Ingest 480p Transcod e HQ Copy 360p Transcod e Audio- only Transcod e Thumbnai l QOS Analytics Cascading Lambda Functions http://www.slideshare.net/AmazonWebServices/arc308-the-serverless-company-using-aws-lambda
  25. 25. “But… in order to utilize Lambda, do I really need to architect event-driven applications?” – you (maybe)
  26. 26. SOA still works.
  27. 27. Amazon API Gateway
  28. 28. A fully managed service for your APIs Create Configure Publish Maintain Monitor Secure
  29. 29. Demo AWS Lambda Function web browser Amazon S3 Dynamic Content Serverless Website Amazon API Gateway Static Content Amazon DynamoDB
  30. 30. Serverless Architecture Patterns
  31. 31. Microservices
  32. 32. Mobile Backend
  33. 33. Real-time Analytics Engine
  34. 34. Serverless Best Practices
  35. 35. AWS Lambda Best Practices 1. Limit your function size – especially for Java (starting the JVM takes time) 2. Node – remember execution is asynchronous. 3. Don’t assume function container reuse – but take advantage of it when it does occur. 1. Don’t forget about disk (500MB /tmp directory provided to each function) 2. Use function Aliases for release. 3. Use the included logger (include details from service- provided context) 4. Create custom metrics (operations-centric, and business-centric)
  36. 36. Amazon API Gateway Best Practices 1. Use request/response mapping templates everywhere within reason, not passthrough. 2. Take ownership of HTTP response codes 3. Use Swagger import/export for cross-account sharing 1. Use Mock integrations 2. Combine with Cognito for managed end user-based access control. 3. Use stage variables (inject API config values into Lambda functions for logging, behavior)
  37. 37. Additional Best Practices 1. Use strategic, consumable naming conventions (Lambda function names, IAM roles, API names, API stage names, etc.) 2. Use naming conventions and versioning to create automation. 3. Externalize authorization to IAM roles whenever possible 1. Least privilege and separate IAM roles 2. Externalize configuration – DynamoDB is great for this. 3. Contact AWS Support before known large scaling events 4. Be aware of service throttling, engage AWS support if so.
  38. 38. A Call to Action
  39. 39. Go build something! Amazon API Gateway AWS Lambda Amazon DynamoDB
  40. 40. Thank you!

×