Slide 1

Slide 1 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. とりあえずサーバーレス Keisuke Nishitani (@Keisuke69) Solutions Architect Amazon Web Services Japan K.K.

Slide 2

Slide 2 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Keisuke Nishitani (@Keisuke69) Manager, Senior Solutions Architect Amazon Web Service Japan K.K Everything will be serverless. ⾳楽 x キャンプ x マンガ フジロッカー ブログ: https://www.keisuke69.net/

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

ではない

Slide 7

Slide 7 text

「お⾦で時間を買う」

Slide 8

Slide 8 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. いかに速く、 価値のある、 システムを作るか ⽬指すべきこと

Slide 9

Slide 9 text

「差別化に繋がらない重労働」 を 「⾃分でやらない」

Slide 10

Slide 10 text

「差別化に繋がらない重労働」 を 「⾃分でやらない」

Slide 11

Slide 11 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コンピューティングの進化 LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC PHYSICAL MACHINES プランニングに「推測」が必要 オンプレで数年稼働 ⼊念な調査 低いイノベーション要素 数ヶ⽉単位でのデプロイ

Slide 12

Slide 12 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コンピューティングの進化 LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC VIRTUAL MACHINES HWの独⽴性 迅速なプロビジョニング よりスケール Elasticなリソース 迅速かつ俊敏 メンテナンス時間がいる

Slide 13

Slide 13 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コンピューティングの進化 LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC CONTAINERIZATION プラットフォーム⾮依存 ⼀貫したランタイム環境 リソースの利⽤効率⾼ 簡単かつ迅速なデプロイ 隔離とサンドボックス 起動時の速度 (数秒でのデプロイ)

Slide 14

Slide 14 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コンピューティングの進化 AWS Lambda AWS Fargate LEVEL OF ABSTRACTION FOCUS ON BUSINESS LOGIC 連続的なスケール 組み込み済の耐障害性 イベント・ドリブン 使⽤量に応じた課⾦ ゼロメンテナンス SERVERLESS

Slide 15

Slide 15 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. おさらい: サーバーレスとは インフラのプロビジョニング不要 管理不要 ⾃動でスケール 価値に対する⽀払い ⾼可⽤かつ安全

Slide 16

Slide 16 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. オペレーションの責任範囲 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の管理範囲 お客様の管理範囲 • データソースとのインテグレーション • 物理ハードウェア、ソフトウェア、ネット ワークとファシリティ • プロビジョニング • アプリケーションコード • コンテナオーケストレーションとプロビ ジョニング • クラスタのスケーリング • 物理ハードウェア、ホストOS/カーネル、 ネットワーキングとファシリティ • アプリケーションコード • データソースとのインテグレーション • セキュリティの構成とアップデート、ネットワー ク構成、タスク管理 • コンテナオーケストレーションのコン トロールプレーン • 物理ハードウェア、ソフトウェア、 ネットワーキングとファシリティ • アプリケーションコード • データソースとのインテグレーション • Workerクラスタ • セキュリティの構成とアップデート、ネット ワーク構成、ファイアウォール、タスク管理 • 物理ハードウェア、ソフトウェ ア、ネットワーキングとファシ リティ • アプリケーションコード • データソースとのインテグレーション • スケーリング • セキュリティの構成とアップデート、ネット ワーク構成、ファイアウォール、タスク管理 • プロビジョニング、スケーリング管理とサー バ管理

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 19

Slide 19 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda release history Lambda Preview Announcement Lambda GA 1.5 GB RAM Amazon API Gateway Launch Amazon DynamoDB Stream Support 300s Execution Duration Python 2.7 Support Java Support Alexa Integration Function Versioning Scheduled CloudWatch Events Support Amazon SWF Support Amazon VPC Support API Gateway Proxy Environment Variables AWS SAM Lambda@Edge Announcement Node 4.2 Support AWS CodeCommit Support C# .Net Support AWS GreenGrass Lambda Support SAM Enhancements Python 3.6 1000 Concurrency Limit PCI Certification AWS SAM Local (now AWS CLI) SOC Certification Per Function Concurrency Controls Node.js 6.10 Tagging AWS X-Ray 3 GB RAM Support HIPAA Eligible Traffic Shifting/Weighted Aliases AWS Serverless Application Repository Announcement .Net Core v2.0 AWS CLI relaunch FedRAMP Certification AWS CLI—Lambda Local, Log tailing PowerShell Support 15-Minute Execution Duration Go Support Node.js v8 Amazon SQS Support .Net 2.1 Support AWS CLI Go Debugging Console AppView 99.95% SLA *As of Dec 2019, does not include region launches 2015 2016 2017 2018 2019 VPC Improvement CloudWatch Logs Insights integration Amazon Linux 2018.03 Node.js 10 Ruby Layers Custom runtimes ALB triggers Kinesis HTTP/2 stream consumers Python 3.7 Stream batch settings Create app in Console RDS Proxy Provisioned Concurrency Node.js 12, Java 11, and Python 3.8 Customize retry behavior Destinations for Async Invokation

Slide 20

Slide 20 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. かつてのAnti-Pattern

Slide 21

Slide 21 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda と RDBMS Amazon RDS Amazon Aurora Lambda function

Slide 22

Slide 22 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda と RDBMS Amazon RDS Amazon Aurora Lambda function

Slide 23

Slide 23 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Photo on Visualhunt.com

Slide 24

Slide 24 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 25

Slide 25 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Using Amazon RDS Proxy with AWS Lambda Amazon RDS Amazon Aurora Lambda function

Slide 26

Slide 26 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Using Amazon RDS Proxy with AWS Lambda Amazon RDS Amazon Aurora Lambda function Amazon RDS Proxy

Slide 27

Slide 27 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDSのコネクションプールマネージャ 東京を含む5リージョンで利用可能 (Public Preview) Lambdaからも利⽤可能 Amazon RDS Proxy

Slide 28

Slide 28 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaのネットワーキング AWS Lambda Service VPC AWS Lambda Execution Environment

Slide 29

Slide 29 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaのネットワーキング AWS Lambda Service VPC AWS Lambda Execution Environment ユーザが所有するVPC Elastic network interface

Slide 30

Slide 30 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaのネットワーキング AWS Lambda Service VPC ユーザが所有するVPC

Slide 31

Slide 31 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Hyperplane Internal network load balancing service Graphic Option 3

Slide 32

Slide 32 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AMAZON Elastic File System AWS Managed NAT AWS PrivateLink AWS Network Load Balancer

Slide 33

Slide 33 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaのネットワーキング AWS Lambda Service VPC ユーザが所有するVPC Elastic network interface VPC to VPC NAT

Slide 34

Slide 34 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaのネットワーキング AWS Lambda Service VPC ユーザが所有するVPC Elastic network interface VPC to VPC NAT

Slide 35

Slide 35 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コールドスタートレイテンシの改善 スケーリング ネットワークインターフェースの共有 VPC環境の改善

Slide 36

Slide 36 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 37

Slide 37 text

Photo on Visual Hunt

Slide 38

Slide 38 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 幅広いアプリケーション実⾏環境 Amazon EC2 AWS Lambda AWS Fargate Amazon ECS Amazon EKS

Slide 39

Slide 39 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. モダンアプリケーション開発を⽀援するサービス On-Premises Cloud More Less Compute Virtual Machine Amazon EC2 AWS Lambda AWS Fargate Amazon ECS Amazon EKS Databases MySQL MySQL on EC2 Amazon RDS MySQL Amazon RDS Aurora Amazon Aurora Serverless Amazon DynamoDB Storage Storage Amazon S3 Messaging ESB Amazon MQ Amazon Kinesis Amazon SQS / Amazon SNS Analytics Hadoop Hadoop on EC2 Amazon EMR Amazon Elasticsearch Service Amazon Athena オペレーション負荷 Serverless

Slide 40

Slide 40 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. MICROSERVICE API API MICROSERVICE MICROSERVICE EVENT API MICROSERVICE EVENT API MICROSERVICE APPLICATION Mobile client Client IoT PERSISTENCE PERSISTENCE Microservices architectures

Slide 41

Slide 41 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. APIはMicroservicesの⽞関

Slide 42

Slide 42 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Mobile apps Websites Services Internet Amazon CloudFront Amazon CloudWatch monitoring API Gateway cache Any other AWS service All publicly accessible endpoints AWS Lambda functions Endpoints in your VPC Regional API Endpoints AWS Lambda functions Endpoints on Amazon EC2 Your VPC AWS API Gatewayを利⽤したAPI管理

Slide 43

Slide 43 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. イベントドリブンアーキテクチャ

Slide 44

Slide 44 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. メッセージングを活⽤してコードからステート を取り除く Queues Simple Fully-managed Any volume Pub/sub Simple Fully-managed Flexible Amazon Simple Queue Service Amazon Simple Notification Service Messaging Synchronization Rapid Fully-managed Real-time Amazon CloudWatch Events

Slide 45

Slide 45 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. データと処理の状態を トラッキング 冗⻑なコードを削除 ワークフローを構築してすべてを オーケストレーション

Slide 46

Slide 46 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. コードを減らし、よりシンプルなインテグレー ション AWS Lambdaで ポーリング Step Functionsによる インテグレーション Start Submit Job Wait X Seconds Get Job Status Job Complete? Set Job Failed Set Job Succeeded Sent Message to SNS End AWS Lambda functions Synchronously Run a Batch Job Publish Success to SNS Publish Error to SNS Start End No Lambda functions

Slide 47

Slide 47 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. クラウドネイティブなアーキテクチャは ⼩さいピースで構成され、疎結合

Slide 48

Slide 48 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon ECS / Amazon EKSを活⽤するケース When you need … • ⻑時間実⾏のジョブ (> 15 minutes) • 予測可能な⾼トラフィック • 低いスタートアップレイテンシ(1秒未満) • HTTP/S以外のリスナーが必要なアプリ • ステートフルなアプリ(EFS連携含む) • サービスとともに実⾏するAgent/daemon/side car • 特定ハードウェア(GPUなど)やKernelのチューニング • Windowsコンテナやレガシーな.NETのサポート When you want … • コンピュート環境な完全な制御 • ハイブリッドやオンプレとのポータビリティ • コンテナイメージのポータビリティ • 異なる購⼊オプション(On-demand、RI、Spot)

Slide 49

Slide 49 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Fargateを活⽤するケース When you need … • ⻑時間実⾏のジョブ (> 15 minutes) • Lambdaが提供する必要のコンピューティングリソース (>3 GB memory) • HTTP/S以外のリスナーが必要なアプリ • サイドカーの実⾏ • 予測可能もしくは少し⻑い開始時間が許容されるスケーリング When you want … • マネージドなコンテナ実⾏環境 • コンテナイメージのポータビリティ

Slide 50

Slide 50 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambdaを活⽤するケース When you need … • イベントに応じたアクションの実⾏ • 様々な利⽤率のサポート • 不透明な需要を処理する能⼒ • より軽量でアプリケーションにフォーカスしたステートレスなコンピューティング When you want to … • ITオペレーションではなくビジネスロジックにフォーカスしたい • シンプルなIT⾃動化 • リアルタイムなデータ処理やサーバーレスなバックエンド • オペレーションの複雑性(パッチ適⽤、スケーリング、⾼可⽤性など)をAWSに任せ たい • 開発とオペレーションの複雑性の軽減

Slide 51

Slide 51 text

S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Slide 52

Slide 52 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. まとめ 明確に使い分けたいニーズがない場合 とりあえずサーバーレス うまくいかなかったらコンテナ、EC2と検討していく 明確に使い分けたいニーズがある場合 特性に応じて幅広い選択肢から選択 悩んだらSolution Architectに相談

Slide 53

Slide 53 text

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.