サーバーレスはどういうことがきっかけになって誕生したのか、利用のユースケースはどのようになってきているのか、これからのサーバーレスはどうやって利用されていくのかを手短に解説
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 ShimokawaSnr. Serverless SpecialistAmazon Web Services Japan
View Slide
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2Kensuke ShimokawaAmazon Web Services JapanSnr. Serverless SpecialistSlides https://speakerdeck.com/_kenshQiita https://qiita.com/_kensh本日の資料もspeakerdeckに共有されています
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
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.耐久性のあるストレージについて4Amazon Simple Storage Service(Amazon S3)Key Key Keyオブジェクトオブジェクトオブジェクト…HTTP/HTTPS• AWSが提供するオブジェクトストレージ• ⾃動的にオブジェクトを冗⻑化§ 99.999999999%の耐久性を実現• 低コストに⼤容量のデータを保存
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.S3 にファイルが置かれたらどうやって処理する?5S3VM を常駐させておく?定期的にポーリング?Service Teams
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.S3 にファイルが置かれたらどうやって処理する?6S3Customerfile登録されたことを通知したときだけ、立ち上がるようにできない?Service Teams
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.S3 にファイルが置かれたらどうやって処理する?7S3Service TeamsCustomerfile関数レベルまで抽象化すればできるのでは?AWS Lambda
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.イベント駆動 / リアルタイム処理8写真をアップロードマルチメディアAWS Lambdaイメージのリサイズ処理Web、モバイル、タブレット向けにリサイズされたイメージを表⽰S3加⼯済み写真の保持イベントS3AWSにアップロードされたデータをリアルタイムに処理。例: サムネイル画像の作成
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 9サーバーレスは、S3 に置かれたタイミングでイベント駆動にファイルを処理することが、始まりだった。
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
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.サーバーレスとは?11サーバーがないサーバーの存在を意識しない
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.オンプレミスからサーバーレスまで12オンプレミス 仮想サーバーマネージド+コンテナマネージド+サーバーレス管理⼯数(⾃動化=⼯数少)アプリケーションデータ・暗号化アプリケーションコード(PGM)サーバーサイド間通信の暗号化冗⻑化プラットフォーム/アプリ実⾏基盤OS保守 , パッチ適⽤ネットワーク構成コンピューティングリソース(物理NW,ストレージ)⾃動化に伴う制限・制約既存移⾏向き 追加/刷新向きお客様お客様 サ"ビス提供者お客様サ"ビス提供者お客様コンテナ
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.従来型のシステム設計13WebサーバーアプリケーションサーバーデータベースサーバーApache,Nginx 等Tomcat,WebLogic 等Oracle DB,MySQL 等プレゼンテーション層 アプリケーション層 永続層Webサーバー Appサーバー DBサーバーLB
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.従来型とサーバーレスの比較14Webサーバー Appサーバー DBサーバーAmazon API Gateway AWS Lambda Amazon DynamoDB処理ロジックREST API データ管理/永続化……サーバー/OSの準備・構築設定・開発作業+ 規模の⾒積もり+ 可⽤性設計ロードバランス設定等+ データ保全の検討サーバー/OSの準備・構築設定・開発作業ü リクエスト量に応じて⾃動スケールü 設計済みのリトライマルチ AZ 構成済ü データ可⽤性LB
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.サーバーレスを選択するビジネス価値15インフラのプロビジョニング不要サーバー管理不要⾃動でスケール価値に対する⽀払い ⾼可⽤かつ安全
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16サーバーレスは、価値を生まない重労働から解放しビジネスに集中するためのパラダイム
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
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 18
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 19静的コンテンツ動的データ記事/試合状況フォロー状況管理認可(フェデレーション)ログの保存ETL処理ログ収集 データ分析クローリング記事に対する処理(タグ付けなど)変更通知画像に対する処理(顔座標の検出)コードで実現 インテグレーションで実現
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 20サーバーレスは、より非同期に
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 21Services ServicesIntegrationEvent Driven
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 22IntegrationAPIDestinationAPIGatewayLambda BatchCloudWatchECSEventBridgeBusKinesisData FirehoseInspectorKinesisData StreamsRedshiftSageMakerpipelineSNS SQSStepFunctionsEvent Driven
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 23IntegrationAPIDestinationAPIGatewayLambda BatchCloudWatchECSEventBridgeBusKinesisData FirehoseInspectorKinesisData StreamsRedshiftSageMakerpipelineSNS SQSStepFunctionsEventBridge PipesEvent Driven
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 24Dec 2022サーバーレスは、より分散化
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.Map - Reduce256 5 4 3 2 17Array566 5 4 3 2 17MAPf (a) = 2 × a12 10 8 6 4 214Reduceg (b, c) = b + c
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.サーバーレス 分散ワークフロー26"Game Number", "Game Length"1, 302, 293, 314, 16‥S3 に置かれた CSV ファイル内のデータにビジネスロジックを適用
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.Map - Reduce276 5 4 3 2 17Distibuted MAPf (a) = 2 × a12 10 8 6 4 214最大 10,000 の並列同時実行をサポート
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 28サーバーレスは、生成 AI のフロントへ
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.Generative AI とサーバーレスの統合29PromptModel Consumer 既存 Model+Model TunerDomain Data +新 ModelModel Builder/ProviderInternet Scale DatasetOrDomain Datasets+新 ModelServerlessExisting ModelTime To Market
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.アジリティと Generative AI の組み合わせ30イノベーションをスピーディーに!Power of Gen AIAmazonBedrockAmazonSageMakerAmazonCode WhispererSpeed of ServerlessAWSLambdaAmazonECSAWSFargateAmazonEventBridgeAWSStepFunctions
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.同期的なモデル呼び出し31Amazon API Gateway AWS Lambda FM Endpoint• Amazon Bedrock• Amazon SageMakerJumpstart• Models hosted on:• EKS• Other computesFM Endpoint• Auth, Rate limiting, Cachingwith Amazon API Gateway• AWS Lambda calling anendpointAPI + Compute• Simple Q/A• Content generation• Text SummarizationUse cases
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.• Amazon Bedrock• Amazon SageMakerJumpstart• Models hosted on:• EKS• Other computesFM Endpoint• Auth, Rate limiting, Cachingwith Amazon API Gateway• Amazon SQS queue providescontrol over the scaling• AWS Lambda calling anendpointAPI + Queue + Compute• Simple Q/A• Content generation• Text SummarizationUse cases非同期的なモデル呼び出し32Amazon API Gateway AWS LambdaAmazon SQS FM Endpoint
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.非同期の場合のレスポンス33Amazon API Gateway AWS LambdaAmazon SQSPolling/WebSocketFM Endpoint• Amazon Bedrock• Amazon SageMakerJumpstart• Models hosted on:• EKS• Other computesFM Endpoint• Auth, Rate limiting, Cachingwith Amazon API Gateway• Amazon SQS queue providescontrol over the scaling• AWS Lambda calling anendpoint• Use polling, WebSocket, orIoT core topic for responseAPI + Queue + Compute• Simple Q/A• Content generation• Text SummarizationUse cases
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
WHY SERVERLESS ?© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.サーバーレスの現在の価値• サーバーレス が担うビジネスロジック、ワークロードは広がる• Lambda が担ってきた “糊付け” の役割は EventBridge Pipes やStep Functions に多く譲っていくことになりそう• 生成 AIではスピードを意識して フロント 部分はサーバーレス で35今後の期待は、、• 今は想像もしていないようなワークロードで Lambda が使われていくのではないか?• 面白いユースケースがあれば、@_kensh まで DM ください
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 ShimokawaSnr. Serverless SpecialistAmazon Web Services Japan