[レポート]Competition of the modern workloads: Serverless vs. Kubernetes on AWS #reinvent

2022.11.30

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

はじめに

「Competition of the modern workloads: Serverless vs. Kubernetes on AWS」のセッションに参加してきたので、その内容についてお話ししていきたいと思います。

タイトルにもあるように、「Serverless」と「Kubernetes」を比較してみよう、という対話形式のセッションでした。 最後には、エンジニア同士の質問などもあり刺激的でした。 (質問内容は取り上げません。)

実はこの話題

社内でも勉強会をしたことがあり、社内で出た結論とは異なる内容になりました。 ここで社内勉強会の内容を閲覧することができます。

結論

結論からお話しすると、会場の見解は、「Serverless」に軍配が上がったようです!

内容

ブレイクアウトセッション形式で、いくつかの項目(Security, Ecosystem, Cost, etc)に対して、会場のみんなが「Kubernetes」と「Serverless」のどちらがいいか、手を挙げる形式で投票していました。 以下の項目がその内容になります。

  • Maintainability
  • Cost
  • Scalability
  • Developer experience
  • Ecosystem
  • Monitoring and logging
  • Security

圧倒的に「Serverless」が負けている箇所は、「Ecosystem」に関する部分くらいしかなく、それ以外は50:50、もしくは「Serverless」が票を集める形となっていました。 (具体的に何人が挙げていたなどの数値はないですが、手を上げた時に周りを見渡してそのような感じでした。最終的な勝利は「Serverless」と最後叫んでいたので、あながち間違いではないと思います。)

いくつかの項目で何を確認したのか

各項目で、それぞれ「Serverless」と「Kubernetes」サービスの利点と欠点を話していました。どういう内容が確認されていたのかを見ていきます。 各項目と「Serverless」・「Kubernetes」に分けて記述しています。

Maintainability

・Serverless

×: Serverless still mean servers (for someone) to manage
○: You no longer have to provision and maintain servers to run your applications, databases, and storage systems
○: No hardware to patch, AWS is taking care of it for you

(直訳:
×: サーバーレスとは、サーバーを(誰かが)管理することを意味します。
○: アプリケーション、データベース、ストレージシステムを動かすために サーバーをプロビジョニングして維持する必要はもうありません。
○: ハードウェアのパッチは不要で、AWSがあなたのために面倒を見てくれます。

・Kubernetes

×: You have to keep up with a short release cycle of 4 month
×: Some updates require configuration files changes
○: You have to be up to date with latest versions that are more secure
(直訳:
×: 4ヶ月という短いリリースサイクルについていかなければならない
×: アップデートによっては、設定ファイルの変更が必要
○: より安全性の高い最新バージョンに更新する必要がある

Cost

・Serverless

×: Pay as you go - you pay for each new function and each run
○: Pay as you go - you don't pay when the service is not running
○: Save money in the form of personnel time
×: Harder to predict the cost

・Kubernetes

○: Predictable
○: Pay-per-use
○: Spot instance supported
×: Have to optimize for type/size of workload

Scalability

・Serverless

×: Can't scale over AWS's hard limits
○: Easy to scale horizontally and vertically
○: No need to worry about physical servers restrictions

・Kubernetes

×: Scaling is the admin's responsibility
○: Automatic autoscalers available by the community and AWS

Developer experience

・Serverless

×: Cannot be agnostic to the infrastructure
○: Implementing actual DevOps methodology

・Kubernetes

×: Might be complex to orchestrate a big env
○: Easy to run locally
○: Easy to replicate envs

Ecosystem

・Serverless

×: Vendor lock-in
○: More and more solutions become compatible with serverless
○: Many serverless services in AWS

・Kubernetes

○: Part of the CNCF ecosystem
○: Standardized protocols and open communication

Monitoring and logging

・Serverless

×: You cannot connect to a physical server
○: No need to monitor and take care of servers

・Kubernetes

○: Supports all standardized monitoring protocols (OpenTelemetry/etc.)
○: Natively integrated with Amazon CloudWatch
×: Has multiple layers and objects that need to be monitored

Security

・Serverless

×: Less defined perimeter
○: No system vulnerabilities to patch and worry about
○: Need to consider mostly package and code vulnerabilities

・Kubernetes

○: Vendor neutral
○: Short release cycle

まとめ

「Serverless」、もしくは「Kubernetes」、どちらを会場の皆さんが選択するのか?結果は、Serverlessになりました。 なぜこの結果を選択したのかを会場の意見を聞いてみたかったですね。

状況によっては、Kubernetesが選択されるケースも十分にあります。

もしかすると、海外と日本のリーチ方法や考え方の違いが、この結果をもたらした可能性もあります。

面白い結果だったので、一読いただいて嬉しいです。ありがとうございました。