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

祝10周年! AWS Lambdaのトレンドを 5分で見る

watany
March 11, 2024

祝10周年! AWS Lambdaのトレンドを 5分で見る

NTT Tech Conference 2024にてお話しした内容です。

watany

March 11, 2024

Transcript

21 slides
  1. Disclaimer • Framework・Javascriptに偏ったネタが多い ◦ HonoのContributorなので • Hono? ◦ Cloudflare Workersでも、AWS

    Lambdaでも動く Webフレームワーク ◦ Express的に書けるし、組み込みのjsxやcssで柔 軟にレスポンスを返せる https://hono.dev/
  2. 1. Function URLs Built-in HTTPS Endpoints = 脱API Gateway •

    機能はシンプル ◦ IAM Auth, CORS • 最大900秒駆動 ◦ API Gateway は29秒以下 https://aws.amazon.com/jp/blogs/aws/announcing-aws-lambda-function-urls-built-i n-https-endpoints-for-single-function-microservices/
  3. 2. Response Streaming ChatGPTでおなじみ「ヌルヌル返るやつ」 - Node.js 14.x ↑ or Custom

    Runtime - 最大20MB返せる(通常6MB) - 前述のLambda Function URLsで30秒の壁を超える
  4. 3. Lambda Web Adaptor LambdaのRequest/Response ⇔ HTTP Request/Response -> 一般的なWebフレームワークがLambdaで動く!

    https://aws.amazon.com/jp/blogs/compute/using-response-streaming-with-aws-lambda-web-adapter-to-optimize-performance/
  5. Detail Rust製で安全かつ高速なExtension • 性能影響も軽微 ◦ 平均レイテンシーは +0.8 ms 程度 ◦

    p99 でも +4 ms 程度 • Docker on Lambdaなら1行足すだけ ◦ Managed Runtimeだと少し面倒
  6. 4. LLRT(Beta) LLRT (Low Latency Runtime) • QuickJS + Rust

    • Node.js互換、WinterJS互換を目指しAWSが開発
  7. 4. LLRT(Beta) > LLRT offers up to over 10x faster

    startup and up to 2x overall lower cost compared to other JavaScript runtimes running on AWS Lambda • つまり ◦ ColdStart性能の改善(Go on AWS Lambdaと同等) ◦ メモリ使用料(& Cost)改善 • 2024/3時点でBeta版なので動向を見守る
  8. まとめ • Lambda組み込みのEndpoint、Streaming Response、フレームワーク対 応という流れ • Monolithでも強力に動くAWS Lambda ◦ 右記Blogも参照

    • LLRTの動向によっては 「全部TypeScriptでいいじゃん」 https://zenn.dev/watany/articles/183d40f8e31a45

More Decks by watany

Other Decks in Technology