Upgrade to Pro — share decks privately, control downloads, hide ads and more …

今Serverlessが面白いわけ - DevLOVE感謝版

今Serverlessが面白いわけ - DevLOVE感謝版

プレゼンテーションスライド @ DevLOVE v2019.10.21
Presentation Slides for DevLOVE v2019.10.21
https://devlove.doorkeeper.jp/events/98173

Yoichi Kawasaki

October 21, 2019
Tweet

More Decks by Yoichi Kawasaki

Other Decks in Technology

Transcript

  1. 今Serverlessが⾯⽩いわけ
    DevLOVE 感謝版
    Yoichi Kawasaki @yokawasa
    ZOZO Technologies, Inc
    Presentation Slides for DevLOVE v2019.10.21

    View Slide

  2. 川崎 庸市 / Yoichi Kawasaki
    @yokawasa
    https://github.com/yokawasa
    Microsoft Corporation
    ZOZO Technologies, Inc (2019.10 - )
    クラウドネイティブ&NoOps愛好家、NoOps Japanコミュニティー共同運営、CKA/CKAD
    過去にモバイルR&Dベンチャー、ヤフー株式会社にて主にインターネットサービスの基盤プラット
    フォーム開発のソフトウェアエンジニア、マイクロソフトにてエンタープライズ検索コンサル、
    Azureのソリューションアーキテクト等を経て現職

    View Slide

  3. View Slide

  4. What and why
    Serverless?

    View Slide

  5. Cloud computing simplified: a Berkeley view on serverless computing
    https://www2.eecs.berkeley.edu/Pubs/TechRpts/2019/EECS-2019-3.pdf

    View Slide

  6. View Slide

  7. Serverless=サーバが無い
    Serverless=サーバを管理する必要がない

    View Slide

  8. The UNIX Super Text 上下
    技術評論社出版 (December 1, 1992)

    View Slide

  9. View Slide

  10. View Slide

  11. Serverless computing
    Wikipedia -Serverless Computing
    Serverless
    AWS -https://aws.amazon.com/serverless/
    Wikipedia
    AWS
    martinfowler.com

    View Slide

  12. https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview

    View Slide

  13. Serverless computing refers to the concept of building and running applications that do not require server management. It describes a
    finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed,
    scaled, and billed in response to the exact demand needed at the moment.
    Serverless computing does not mean that we no longer use servers to host and run code; nor does it mean that operations engineers
    are no longer required. Rather, it refers to the idea that consumers of serverless computing no longer need to spend time andresources
    on server provisioning, maintenance, updates, scaling, and capacity planning. Instead, all of these tasks and capabilities are handled by a
    serverless platform and are completely abstracted away from the developers and IT/operations teams. As a result, developers focus on
    writing their applications’ business logic. Operations engineers are able to elevate their focus to more business critical tasks.
    A serverless computing platform may provide one or both of the following:
    1. Functions-as-a-Service (FaaS), which typically provides event-driven computing. Developers run and manage application code with
    functions that are triggered by events or HTTP requests. Developers deploy small units of code to the FaaS, which are executed as
    needed as discrete actions, scaling without the need to manage servers or any other underlying infrastructure.
    2. Backend-as-a-Service (BaaS), which are third-party API-based services that replace core subsets of functionality in an application.
    Because those APIs are provided as a service that auto-scales and operates transparently, this appears to the developer to be
    serverless.
    https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview
    スケーリングされ、使った分だけ課金
    • Functions-as-a-Service (FaaS)
    • Backend-as-a-Service (BaaS)

    View Slide

  14. View Slide

  15. 1970 1980 1990 2000 2010 2020
    2006 2008 2010
    Amazon EC2
    Google
    App Engine Microsoft
    Azure
    Oracle Cloud
    2012
    Google
    Compute
    Engine
    Alibaba Cloud
    2006.8 2008.4 2010.2 2012.5

    View Slide

  16. 2014 2015 2016 2017 2018
    AWS Lambda
    2014.11
    Google Cloud
    Functions
    Azure
    Functions
    2016.2
    2016.3
    IBM
    Cloud Functions
    Serverless
    Framework
    2015.10
    2016.12
    OpenWhisk
    (OSS) by IBM
    Fn Project
    (OSS) by Oracle
    2017.10
    Serverless
    Whitepaper
    by CNCF
    2018.2
    2019
    2018.12
    Oracle
    Function
    2018.7
    Knative
    by Google

    View Slide

  17. Tech Adoption 2019 https://www.infoq.com/about-infoq
    CHASM

    View Slide

  18. View Slide

  19. Serverless computing refers to the concept of building and running applications that do not require server management. It describes a
    finer-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed,
    scaled, and billed in response to the exact demand needed at the moment.
    Serverless computing does not mean that we no longer use servers to host and run code; nor does it mean that operations engineers
    are no longer required. Rather, it refers to the idea that consumers of serverless computing no longer need to spend time andresources
    on server provisioning, maintenance, updates, scaling, and capacity planning. Instead, all of these tasks and capabilities are handled by a
    serverless platform and are completely abstracted away from the developers and IT/operations teams. As a result, developers focus on
    writing their applications’ business logic. Operations engineers are able to elevate their focus to more business critical tasks.
    A serverless computing platform may provide one or both of the following:
    1. Functions-as-a-Service (FaaS), which typically provides event-driven computing. Developers run and manage application code with
    functions that are triggered by events or HTTP requests. Developers deploy small units of code to the FaaS, which are executed as
    needed as discrete actions, scaling without the need to manage servers or any other underlying infrastructure.
    2. Backend-as-a-Service (BaaS), which are third-party API-based services that replace core subsets of functionality in an application.
    Because those APIs are provided as a service that auto-scales and operates transparently, this appears to the developer to be
    serverless.
    https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview
    開発者や運用者が本質的な
    ビジネスロジックの開発や、クリティカルタスクに集中できる
    サーバ管理が不要 需要に応じてスケーリングされ、使った分だけ課金
    • Functions-as-a-Service (FaaS)
    • Backend-as-a-Service (BaaS)

    View Slide

  20. View Slide

  21. 経済産業省:平成 29 年度我が国における
    データ駆動型社会に係る基盤整備

    View Slide

  22. 内閣府 令和元年版高齢社会白書
    https://www8.cao.go.jp/kourei/whitepaper/w-2019/gaiyou/pdf/1s1s.pdf
    平成最後の時価総額ランキング。日本と世界その差を生んだ30年とは?
    https://media.startup-db.com/research/marketcap-global
    ⾦融・製造業主導の経済から、ITを駆使した
    ソフトウェア産業が世界を掌握
    デモグラフィックの観点:減り続ける労働⼈⼝

    View Slide

  23. View Slide

  24. View Slide

  25. Monolith Microservices
    Infrastructure
    Host OS
    Hypervisor
    Guest
    OS
    Guest
    OS
    Bins/
    Libs
    Bins/
    Libs
    App App
    Infrastructure
    Host OS
    Container Engine
    Bins/
    Libs
    Bins/
    Libs
    App App

    View Slide

  26. HTTP
    HTTP Proxy

    View Slide

  27. /bin/sh
    /bin/sh
    /bin/sh
    毎回Fork
    でシェルからスクリプト実行
    コストが大きい

    View Slide

  28. View Slide

  29. View Slide

  30. ベンダーロックインをなくすための標準化を
    進めるベンダー中立な団体
    https://www.cncf.io/
    マルチプラットフォーム間での標準化がもたらす
    価値について疑問視する意見はあるものの
    標準化は着実に進められています

    View Slide

  31. • Events ( Cloud Event and it’s API & SDK for CE )
    • Workflows / Function Composition
    • Event Orchestration / Chaining
    • Function Signatures
    • Common function logging, observing, and monitoring
    • Common function model
    • Common function Benchmark framework
    CNCF Serverless WG / Proposals
    https://github.com/cncf/wg-serverless/tree/master/proposals

    View Slide

  32. CNCF Serverless WGを中心に進められている
    イベントスキーマ標準化のための共通仕様
    • 異なるシステム間でのイベントの相互運用性(”
    interoperability”)確保が目的
    • イベントはさまざまなプロトコルで配送可能にする
    • 業界標準(HTTP, AMQP, MQTT, SMTP, JSON)、OSS(Kafka, AVRO,
    NATS)、ベンダー固有(Azure Event Grid), etc.
    https://cloudevents.io/
    https://github.com/cloudevents/spec/blob/master/json-format.md
    サンプル: CloudEvent JSON (data部分が文字列の例)
    Cloud Event Proposal https://github.com/cncf/wg-serverless/tree/master/proposals/cloudevents
    CloudEvents Specs: https://github.com/cloudevents/spec

    View Slide

  33. OSS Serverless Platform
    OSS Serverless Framework
    Public Cloud

    View Slide

  34. https://www.pulumi.com/serverless/ https://github.com/pulumi/examples/blob/master/azure-ts-
    functions/index.ts

    View Slide

  35. View Slide

  36. View Slide

  37. • https://aws.amazon.com/jp/blogs/news/firecracker-lightweight-
    virtualization-for-serverless-computing/
    • https://github.com/firecracker-
    microvm/firecracker/blob/master/docs/design.md

    View Slide

  38. https://quarkus.io/
    • https://developers.redhat.com/blog/2019/03/07/quarkus-next-
    generation-kubernetes-native-java-framework/
    • https://publickey1.jp/blog/19/javaquarkusjavajavared_hat.html

    View Slide

  39. Azure serverless microservice reference architecture
    AWS serverless application lens

    View Slide

  40. 長時間実行、高速ストレージ、スケーラブルデータストア、
    高速ネットワーク、ワークフロー管理、P2P通信、etc

    View Slide

  41. View Slide

  42. View Slide

  43. Kubernetes-based Serverless
    • Knative
    • KEDA
    • Virtual Kubelet
    • Dapr (*)

    View Slide

  44. https://github.com/knative
    インフラストラクチャの抽象化
    ネットワークの抽象化
    アプリライフサイクルの抽象化
    Kubernetes + Service Meshを基盤にアプリ
    のビルド・デプロイ・管理機能を提供
    参考: Gabe Monroy on Twitter: "Strata of the Container Ecosystem
    https://twitter.com/gabrtv/status/539805332432637952

    View Slide

  45. インフラストラクチャ
    の抽象化
    ネットワーク
    の抽象化
    アプリライフサイクル
    の抽象化
    • コードのビルド
    • パッケージング
    • リクエスト受信
    • ルーティング
    • スケール
    • イベントソースの
    抽象化
    • コードの発火
    https://knative.dev/docs/serving/ https://knative.dev/docs/eventing/
    https://knative.dev/docs/build/

    View Slide

  46. マイクロサービス、イベントドリブンアプリを容易に構築することを可能にする
    Runtime、サービス間通信、ステート管理、Pub/Sub、Actors、分散トレーシングな
    どの機能をサイドカーとして提供
    https://github.com/dapr/dapr

    View Slide

  47. https://github.com/kedacore/keda
    • KubernetesのHPA (Horizontal Pod
    Autoscaler)は全PodのCPUやメモリ消費率
    でスケールを調整するのが基本動作
    • KEDAはRabbit MQ 、Kafka Streaming、
    Azure Storage Queue、Azure Service Bus
    Queueなど非HTTPなイベントに連動した
    Podのスケール調整ができるのが特徴
    • KEDAがZeroスケールイン・アウトして、
    それ以外はHPAがスケールイン・アウト
    Storage
    Queue
    ServiceBus
    Queue
    Kafka
    RabbitMQ
    HPA KEDA
    1->N or N->1 0->1 or 1->0

    K E D A

    View Slide

  48. View Slide

  49. kubelet
    kube proxy
    Container
    Container
    runtime
    Virtual Kubelet
    • Alibaba Cloud ECI Provider
    • Azure Container Instances Provider
    • Azure Batch GPU Provider
    • AWS Fargate Provider
    • HashiCorp Nomad
    • OpenStack Zun
    https://github.com/virtual-kubelet/virtual-kubelet

    View Slide

  50. View Slide

  51. Let’s innovate

    View Slide