$30 off During Our Annual Pro Sale. View Details »

サーバーレスはどこから来たのか サーバーレスは何者か サーバーレスはどこへ行くのか / Where did serverless come from?

kensh
November 12, 2023

サーバーレスはどこから来たのか サーバーレスは何者か サーバーレスはどこへ行くのか / Where did serverless come from?

サーバーレスはどういうことがきっかけになって誕生したのか、利用のユースケースはどのようになってきているのか、これからのサーバーレスはどうやって利用されていくのかを手短に解説

kensh

November 12, 2023
Tweet

More Decks by kensh

Other Decks in Technology

Transcript

  1. 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

    View Slide

  2. 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に共有されています

    View Slide

  3. 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

    View Slide

  4. 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%の耐久性を実現
    • 低コストに⼤容量のデータを保存

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  10. 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

    View Slide

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

    View Slide

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





    様 サ
    "









    "












    View Slide

  13. 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

    View Slide

  14. 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

    View Slide

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

    View Slide

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

    View Slide

  17. 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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  22. 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

    View Slide

  23. 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

    View Slide

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

    View Slide

  25. 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

    View Slide

  26. 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 ファイル内のデータにビジネスロジックを適用

    View Slide

  27. 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 の並列同時実行をサポート

    View Slide

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

    View Slide

  29. 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

    View Slide

  30. 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

    View Slide

  31. 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

    View Slide

  32. 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

    View Slide

  33. 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

    View Slide

  34. 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

    View Slide

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

    View Slide

  36. 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

    View Slide