Slide 1

Slide 1 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. J A W S - U G 長 崎 サーバーレスはどこから来たのか サーバーレスは何者か サーバーレスはどこへ行くのか Kensuke Shimokawa Snr. Serverless Specialist Amazon Web Services Japan

Slide 2

Slide 2 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2 Kensuke Shimokawa Amazon Web Services Japan Snr. Serverless Specialist Slides https://speakerdeck.com/_kensh Qiita https://qiita.com/_kensh 本日の資料もspeakerdeckに共有されています

Slide 3

Slide 3 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスはどこから来たのか 3

Slide 4

Slide 4 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 耐久性のあるストレージについて 4 Amazon Simple Storage Service (Amazon S3) Key Key Key オブジェクト オブジェクト オブジェクト … HTTP/HTTPS • AWSが提供するオブジェクトストレージ • ⾃動的にオブジェクトを冗⻑化 § 99.999999999%の耐久性を実現 • 低コストに⼤容量のデータを保存

Slide 5

Slide 5 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. S3 にファイルが置かれたらどうやって処理する? 5 S3 VM を常駐させておく? 定期的にポーリング? Service Teams

Slide 6

Slide 6 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. S3 にファイルが置かれたらどうやって処理する? 6 S3 Customer file 登録されたことを通知 したときだけ、立ち上 がるようにできない? Service Teams

Slide 7

Slide 7 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. S3 にファイルが置かれたらどうやって処理する? 7 S3 Service Teams Customer file 関数レベルまで抽象化 すればできるのでは? AWS Lambda

Slide 8

Slide 8 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. イベント駆動 / リアルタイム処理 8 写真をアップロード マルチメディア AWS Lambda イメージのリサイズ処理 Web、モバイル、タブレット向けに リサイズされたイメージを表⽰ S3 加⼯済み写真の保持 イベント S3 AWSにアップロードされたデータをリアルタイムに処理。 例: サムネイル画像の作成

Slide 9

Slide 9 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9 サーバーレスは、S3 に置かれたタイミングで イベント駆動にファイルを処理することが、 始まりだった。

Slide 10

Slide 10 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスは何者か 10

Slide 11

Slide 11 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスとは? 11 サーバーがない サーバーの存在を意識しない

Slide 12

Slide 12 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. オンプレミスからサーバーレスまで 12 オンプレミス 仮想サーバー マネージド +コンテナ マネージド +サーバーレス 管理⼯数(⾃動化=⼯数少) アプリケーションデータ・暗号化 アプリケーションコード(PGM) サーバーサイド間通信の暗号化 冗⻑化 プラットフォーム/アプリ実⾏基盤 OS保守 , パッチ適⽤ ネットワーク構成 コンピューティングリソース (物理NW,ストレージ) ⾃動化に伴う制限・制約 既存移⾏向き 追加/刷新向き お 客 様 お 客 様 サ " ビ ス 提 供 者 お 客 様 サ " ビ ス 提 供 者 お 客 様 コ ン テ ナ

Slide 13

Slide 13 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 従来型のシステム設計 13 Web サーバー アプリケーション サーバー データベース サーバー Apache, Nginx 等 Tomcat, WebLogic 等 Oracle DB, MySQL 等 プレゼンテーション層 アプリケーション層 永続層 Webサーバー Appサーバー DBサーバー LB

Slide 14

Slide 14 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 従来型とサーバーレスの比較 14 Webサーバー Appサーバー DBサーバー Amazon API Gateway AWS Lambda Amazon DynamoDB 処理ロジック REST API データ管理/永続化 … … サーバー/OSの準備・構築 設定・開発作業 + 規模の⾒積もり + 可⽤性設計 ロードバランス設定等 + データ保全の検討 サーバー/OSの準備・構築 設定・開発作業 ü リクエスト量に応じて ⾃動スケール ü 設計済みのリトライ マルチ AZ 構成済 ü データ可⽤性 LB

Slide 15

Slide 15 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスを選択するビジネス価値 15 インフラのプロビジョニング不要 サーバー管理不要 ⾃動でスケール 価値に対する⽀払い ⾼可⽤かつ安全

Slide 16

Slide 16 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16 サーバーレスは、価値を生まない重労働から 解放しビジネスに集中するためのパラダイム

Slide 17

Slide 17 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスはどこへ行くのか 17

Slide 18

Slide 18 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18

Slide 19

Slide 19 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19 静的コンテンツ 動的データ 記事/試合状況 フォロー状況管理 認可 (フェデレーション) ログの保存 ETL処理 ログ収集 データ分析 クローリング 記事に対する処理 (タグ付けなど) 変更通知 画像に対する処理 (顔座標の検出) コードで実現 インテグレーションで実現

Slide 20

Slide 20 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20 サーバーレスは、より非同期に

Slide 21

Slide 21 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21 Services Services Integration Event Driven

Slide 22

Slide 22 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22 Integration API Destination API Gateway Lambda Batch CloudWatch ECS EventBridge Bus Kinesis Data Firehose Inspector Kinesis Data Streams Redshift SageMaker pipeline SNS SQS Step Functions Event Driven

Slide 23

Slide 23 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23 Integration API Destination API Gateway Lambda Batch CloudWatch ECS EventBridge Bus Kinesis Data Firehose Inspector Kinesis Data Streams Redshift SageMaker pipeline SNS SQS Step Functions EventBridge Pipes Event Driven

Slide 24

Slide 24 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24 Dec 2022 サーバーレスは、より分散化

Slide 25

Slide 25 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Map - Reduce 25 6 5 4 3 2 1 7 Array 56 6 5 4 3 2 1 7 MAP f (a) = 2 × a 12 10 8 6 4 2 14 Reduce g (b, c) = b + c

Slide 26

Slide 26 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレス 分散ワークフロー 26 "Game Number", "Game Length" 1, 30 2, 29 3, 31 4, 16 ‥ S3 に置かれた CSV ファイル内のデータにビジネスロジックを適用

Slide 27

Slide 27 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Map - Reduce 27 6 5 4 3 2 1 7 Distibuted MAP f (a) = 2 × a 12 10 8 6 4 2 14 最大 10,000 の並列同時実行をサポート

Slide 28

Slide 28 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28 サーバーレスは、生成 AI のフロントへ

Slide 29

Slide 29 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Generative AI とサーバーレスの統合 29 Prompt Model Consumer 既存 Model + Model Tuner Domain Data + 新 Model Model Builder/Provider Internet Scale Dataset Or Domain Datasets + 新 Model Serverless Existing Model Time To Market

Slide 30

Slide 30 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. アジリティと Generative AI の組み合わせ 30 イノベーションを スピーディーに! Power of Gen AI Amazon Bedrock Amazon SageMaker Amazon Code Whisperer Speed of Serverless AWS Lambda Amazon ECS AWS Fargate Amazon EventBridge AWS Step Functions

Slide 31

Slide 31 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 同期的なモデル呼び出し 31 Amazon API Gateway AWS Lambda FM Endpoint • Amazon Bedrock • Amazon SageMaker Jumpstart • Models hosted on: • EKS • Other computes FM Endpoint • Auth, Rate limiting, Caching with Amazon API Gateway • AWS Lambda calling an endpoint API + Compute • Simple Q/A • Content generation • Text Summarization Use cases

Slide 32

Slide 32 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Amazon Bedrock • Amazon SageMaker Jumpstart • Models hosted on: • EKS • Other computes FM Endpoint • Auth, Rate limiting, Caching with Amazon API Gateway • Amazon SQS queue provides control over the scaling • AWS Lambda calling an endpoint API + Queue + Compute • Simple Q/A • Content generation • Text Summarization Use cases 非同期的なモデル呼び出し 32 Amazon API Gateway AWS Lambda Amazon SQS FM Endpoint

Slide 33

Slide 33 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 非同期の場合のレスポンス 33 Amazon API Gateway AWS Lambda Amazon SQS Polling/WebSocket FM Endpoint • Amazon Bedrock • Amazon SageMaker Jumpstart • Models hosted on: • EKS • Other computes FM Endpoint • Auth, Rate limiting, Caching with Amazon API Gateway • Amazon SQS queue provides control over the scaling • AWS Lambda calling an endpoint • Use polling, WebSocket, or IoT core topic for response API + Queue + Compute • Simple Q/A • Content generation • Text Summarization Use cases

Slide 34

Slide 34 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. まとめ 34

Slide 35

Slide 35 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. サーバーレスの現在の価値 • サーバーレス が担うビジネスロジック、ワークロードは広がる • Lambda が担ってきた “糊付け” の役割は EventBridge Pipes や Step Functions に多く譲っていくことになりそう • 生成 AIではスピードを意識して フロント 部分はサーバーレス で 35 今後の期待は、、 • 今は想像もしていないようなワークロードで Lambda が使われて いくのではないか? • 面白いユースケースがあれば、@_kensh まで DM ください

Slide 36

Slide 36 text

WHY SERVERLESS ? © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kensuke Shimokawa Snr. Serverless Specialist Amazon Web Services Japan