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.

ServerlessConf Tokyo キーノート

3,460 views

Published on

2016年10月1日に開催されたServerlessConf Tokyoキーノート資料 - Go Serverless, Compute Only When it Matters!

Published in: Technology
  • Be the first to comment

ServerlessConf Tokyo キーノート

  1. 1. © 2016 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Olivier Klein , AWS Solutions Architect, Asia-Pacific October 2016 ServerlessConf, Tokyo Go Serverless, Compute Only When it Matters!
  2. 2. The Monolithic Architecture
  3. 3. The Monolithic Architecture - Antipattern   Difficult to scale   Single point of failure   Not fault-tolerant   Difficult to work across teams, often slow to iterate on new functionalities
  4. 4. The Microservices Architecture
  5. 5. Microservices advocate creating a system from a collection of small, isolated services, each of which owns their data, scalable and resilient to failure
  6. 6. Dr. Werner Vogels CTO - Amazon
  7. 7. No server is easier to manage…
  8. 8. …than no server. No server is easier to manage…
  9. 9. AWS Lambda No server is easier to manage… …than no server.
  10. 10. The Microservices Architecture
  11. 11. Serverless Microservices
  12. 12. Architect to be Serverless Serverless   Fully Managed •  No provisioning •  Zero Administration ( •  High-Availability   Developer Productivity •  Focus on the code •  Innovate rapidly •  Reduce time to market   Scalability •  Automatically •  Scale up and down Up/Down
  13. 13. Many Serverless Options on AWS Serverless Storage DatabaseNetwork Compute Content DeliveryMessaging and QueuesSecurity Gateways User Management Monitoring & Logging Internet of Things Machine Learning Streaming Analytics
  14. 14. 13 Regions 35 Availability Zones 63 Edge Locations Continuous Expansion AWS Global Infrastructure AWS (As of September, 2016)
  15. 15. 13 Regions 35 Availability Zones 63 Edge Locations Continuous Expansion AWS Global Infrastructure AWS New! New! (As of September, 2016)
  16. 16. AWS Lambda   Run your code in the cloud, fully managed and highly-available   Triggered through API calls or state changes in your setup (S3, DynamoDB, SNS, Kinesis)   Scales automatically to match the incoming event rate   Charged per 100ms execution time Amazon Kinesis Amazon Lambda Amazon S3 Amazon DynamoDB Amazon API Gateway Amazon SNS
  17. 17. Amazon S3 Amazon DynamoDB Amazon Kinesis AWS CloudFormation AWS CloudTrail Amazon CloudWatch Amazon SNS Amazon
 SES Amazon
 API Gateway Amazon Cognito AWS
 IoT Amazon
 Alexa Cron events DATA STORES ENDPOINTS REPOSITORIES EVENT/MESSAGE SERVICES Event Sources that integrate with AWS Lambda (AWS Lambda ) … and the list continues to grow. Amazon Config
  18. 18. How to build application backends? Back-end logic DatabaseMobile
  19. 19. How to build serverless microservices? Serverless Microservices AWS Lambda Amazon API Gateway Amazon DynamoDB Microservice
  20. 20. How to build serverless microservices? Serverless Microservices AWS Lambda Amazon API Gateway Amazon DynamoDB Microservice 1 Microservice 2 Microservice N ...
  21. 21. Amazon API Gateway   Fully managed and scalable RESTful API gateway service   Powered by our content delivery network via 63 global edge locations   Provides DDoS protection and throttling capabilities   Multiple API stages which you define (e.g. dev, test, prod) AWS Lambda Amazon API Gateway Amazon EC2 AWS API On-prem server
  22. 22. Amazon API Gateway: Authorization Amazon API Gateway   Allows unauthenticated requests, or authorizes via AWS IAM   Amazon Cognito or AWS STS for temporary credential generation   API Keys available to monitor individual app calls   You can create API Key specific throttling and usage plans Basic – 5 TPS Premium – 100 TPS Power – No throttling API Keys – Usage Plans Amazon Cognito AWS IAM
  23. 23. Webhooks – Integrate with other platforms Facebook Page AWS Lambda Slack Channel Amazon API Gateway Amazon DynamoDB Incoming Webhook Oli just posted on your page! Oli | 2016-10-01 | Hello
  24. 24. Okasan Online Securities (岡三オンライン証券株式会社) “AWS のクラウドネイティブアーキテクチャー により運用面での作業はほとんど必要なくなり、 コストも従来型のアーキテクチャーと比較して、 7 分の 1 程度にまで削減することができてい ます。 今のところセキュリティ、実績、コスト、機能の 面で AWS に勝るクラウドベンダーはありませ ん。 ” 野崎 保 氏 事業戦略担当部長   Online Trading Demo Platform   Live Stock Market Feed and Order Management delivered via Amazon API Gateway and AWS Lambda   1/7 of cost reduction
  25. 25. How to get the web app to the browser? Web ?
  26. 26. Storage and Delivery of the App Amazon S3 Amazon CloudFront   Amazon S3 •  Highly available object storage •  Designed for 99.999999999% durability •  Offers HTTP / HTTPS endpoint to objects   Amazon CloudFront •  Content Delivery Network with 63 edge locations across the world •  Caches content on edge locations for low latency
  27. 27. Amazon S3 Amazon CloudFront Browser
  28. 28. Serverless App Architecture JavaScript SDK Browser Amazon S3 Amazon CloudFront Amazon Lambda Amazon DynamoDB Amazon API Gateway Any other AWS Services (e.g. SNS, SES, ElastiCache etc.)
  29. 29. Introducing Chalice Chalice Serverless micro- framework for AWS   Deploy APIs quickly via AWS Lambda and Amazon API Gateway github.com/awslabs/chalice $ chalice new-project helloworld $ cat helloworld/app.py from chalice import Chalice app = Chalice(app_name="helloworld") @app.route("/") def index(): return {"hello": "world"} $ chalice deploy ... Your app is available at: https://endpoint/dev $ curl https://endpoint/dev {"hello": "world"}
  30. 30. Serverless with AWS Amazon Lambda Amazon API Gateway Amazon S3Amazon CloudFront Browser
  31. 31. MOBILE CHAT APP AD DATA ANALYTICS AND ROUTING MOBILE APP ANALYTICS IMAGE CONTENT FILTERING REAL-TIME VIDEO AD BIDDING NEWS CONTENT PROCESSING GENE SEQUENCE SEARCH CLOUD TELEPHONY DATA PROCESSING WEB APPLICATIONS WEB APPLICATIONSTHREAT INTELLIGENCE AND ANALYTICS NEWS CONTENT PROCESSING GAME METRICS ANALYTICS Serverless Applications
  32. 32. How about deployments?
  33. 33. Versioning   Immutable versions of functions   Per version configuration   Per version Cloudwatch metrics Cloudwatch Logs contain version attribute   Aliases to “label” a version release   $LATEST contains latest code
  34. 34. $LATEST(95) STABLE TESTING 94 X 93 X 92 Update Alias to Deploy
  35. 35. $LATEST(95) STABLE TESTING 94 X X 93 92 Update Alias to Deploy
  36. 36. API Stages API
  37. 37. API Gateway Stage Variables API Gateway
  38. 38. API Gateway Stage Variables API Gateway
  39. 39. API Gateway Lambda Custom Domain /prod/Resources FunctionName:stable https://api.example.com /dev/Resources FunctionName:$LATEST https://dev.example.com /qa/Resources FunctionName:qa https://qa.example.com Pin your environment with stage variables
  40. 40. Alexa, Hello!
  41. 41. The Power of Speech: Alexa Alexa, the voice service that powers Echo, provides capabilities, or skills, that enable customers to interact with devices using voice Alexa Skills Kit (ASK) allows everyone to build and publish their own skills   Skills can be powered by AWS Lambda
  42. 42. The Power of Speech: Alexa Node.js SDK available to quickly build new voice skills. github.com/amzn/alexa-skills-kit-js var AlexaSkill = require('./AlexaSkill'); var HelloWorld= function () { AlexaSkill.call(this, APP_ID); }; // Extend AlexaSkill HelloWorld.prototype = Object.create(AlexaSkill.prototype); HelloWorld.prototype.constructor = HelloWorld; HelloWorld.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) { var speechOutput = ”Hello World”; response.tell(speechOutput); };
  43. 43. Build your own Alexa Skill! Amazon Echo Alexa Skills Kit AWS Lambda Amazon DynamoDB (Facebook Page Post)
  44. 44. Final Thoughts   Use Amazon API Gateway to build a front-door to all your microservices (AWS Lambda, Docker, EC2 etc.)   Use microservices with polyglot persistence to avoid bottlenecks, schema issues, quick iterations and allow independent scalability (and caching)   Create many version and stages – no additional charges for APIs, allows for backwards compatibility   Use serverless interfaces when possible – HTML5 and JS frameworks like React or Angular are useful
  45. 45. © 2016 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Olivier Klein , AWS Solutions Architect, Asia-Pacific October 2016 ServerlessConf, Tokyo Thank You!

×