Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
新常識! Javascript×AWS Lambdaがアツい!!
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
watany
June 27, 2024
Technology
740
3
Share
新常識! Javascript×AWS Lambdaがアツい!!
color is クラウドLT大会vol.9 で発表させていただいた内容になります。
https://saison-coloris.connpass.com/event/320707/
watany
June 27, 2024
More Decks by watany
See All by watany
Equip GitHub Copilot CLI
watany
3
1.3k
SkillsをS3 Filesに置く時のあれこれ
watany
4
2.1k
App Runner最近使ってなかったのなんでだっけ
watany
1
100
CDK Deployのための ”反響定位”
watany
5
1k
ロボットのための工場に灯りは要らない
watany
12
3.6k
Agentic Coding 実践ワークショップ
watany
56
38k
たかが特別な時間の終わり / It's Only the End of Special Time
watany
37
12k
まだ間に合う! 2025年のhono/ssg事情
watany
4
1k
AIのメモリー
watany
14
1.9k
Other Decks in Technology
See All in Technology
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
420
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Djangoユーザが知っ得なPostgreSQL機能 - 設計の選択肢を増やす / Djang-use-PostgreSQL
soudai
PRO
0
170
BigQuery の Cross-cloud Lakehouse への歩み
phaya72
2
550
AI Engineering Summit Tokyo 2026 AIの前に、やることがある 〜医療データ企業の4フェーズ〜
dtaniwaki
0
1.7k
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
5
3.6k
AI活用を推進するために ファインディが下した、一つの小さな決断
starfish719
0
240
JEP 522 Deep Dive - G1 GC同期コスト削減によるスループット向上を徹底検証&解説
tabatad
1
770
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
2.6k
Cloud Run のアップデート 触ってみる&紹介
gre212
0
300
AI Testing Talks: Challenges of Applying AI in Software Testing: From Hype to Practical Use
exactpro
PRO
1
120
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
550
The SEO Collaboration Effect
kristinabergwall1
1
470
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
150
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
130
Git: the NoSQL Database
bkeepers
PRO
432
67k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
840
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
940
Code Review Best Practice
trishagee
74
20k
A Modern Web Designer's Workflow
chriscoyier
698
190k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Transcript
color is クラウドLT大会vol.9 新常識!JavaScript × AWS Lambdaがアツい!! 2024-06-27
自己紹介 • 渡邉 洋平(watany) ◦ NTTテクノクロス株式会社 ◦ JAWS-UG東京 運営 ◦
AWS Ambassadors (associate) • 合同で勉強会できる企業を探しています ◦ Jr. Champion/TopEngineer育成とか ◦ 普通にTechの勉強会とか
今日の目標 • AWS Lambda のJavaScript(TypeScript, Node.js)のトレンドを紹介する ◦ 従来、拘りなくLambdaを書く場合にはPythonがファーストチョイスだった(個人 研究) ◦
バックエンド、インフラでもJavaScript採用で効率化できそうなアップデート群を 紹介 • お詫び ◦ JavaScriptと言いつつ、TypeScript前提で話す
JavaScript × AWS Lambdaの新常識
JavaScript × AWS Lambdaの新常識 1. TypeScript × AWS CDK 2.
LLRT 3. Lambda Web Adaptor 4. Response Streaming
1. TypeScript × AWS CDK • AWS CDKとは? ◦ Framework
for CloudFormation ◦ 概要は右のグラレコが必要十分 • TypeScriptとは? ◦ JavaScriptのSuperset ◦ 強力かつ柔軟な型システム をJavascriptに付与 引用:使い慣れたプログラミング言語でクラウド環境を構築 ! AWS CDK をグラレコで解説 https://aws.amazon.com/jp/builders-flash/202309/awsgeek-aws-cdk/
1. TypeScript × AWS CDK AWS CDKは多言語対応とあるが…? • Toolネイティブ対応は”TypeScript” ◦
Python、GoなどはJsiiが変換して対応(まれにバグを踏む) • 2022年度の利用率は”72%”がJS/TS ◦ 2024年現在の肌感覚でも同様 ◦ JAWS-UG CDK支部も https://matthewbonig.com/posts/community-survey-2022/
1. TypeScript × AWS CDK 「NodejsFunction」でBundle部分をCDKに任せて、TypeScript ファーストのLambda開 発体験
JavaScript × AWS Lambdaの新常識 1. TypeScript × AWS CDK 2.
LLRT 3. Lambda Web Adaptor 4. Response Streaming
2. LLRT LLRT (Low Latency Runtime) • Node.js互換、WinterJS互換を目指し、AWSが開発するJS Runtime ◦
QuickJS + Rust ◦ 注)2024/6時点でBeta版
Cold Start:Node.js(1500ms) https://github.com/awslabs/llrt/tree/main/benchmarks
Cold Start:LLRT ( > 100ms) https://github.com/awslabs/llrt/tree/main/benchmarks
2. LLRT > LLRT offers up to over 10x faster
startup and up to 2x overall lower cost compared to other JavaScript runtimes running on AWS Lambda • つまりJS/TSのコードのままで ◦ ColdStart性能の改善 ▪ Go on AWS Lambdaと同等 ◦ メモリ使用量の改善 ▪ ≒ Costの改善
JavaScript × AWS Lambdaの新常識 1. TypeScript × AWS CDK 2.
LLRT 3. Lambda Web Adaptor 4. Response Streaming
3. Lambda Web Adaptor LambdaのEvents ⇔ HTTP Request/Response • Express.jsやNext.jsのWebフレームワークがAWS
Lambdaでそのまま動 く! https://aws.amazon.com/jp/blogs/compute/using-response-streaming-with-aws-lambda-web-adapter-to-optimize-performance/
3. Lambda Web Adaptor 安全かつ高速なLambda Extensions • Rust製で性能影響も軽微 ◦ 平均レイテンシーは
+0.8 ms 程度 ◦ p99 でも +4 ms 程度 • Docker on Lambdaなら1行足すだけ ◦ Managed Runtimeだと少し面倒
Extensionsのアーキテクチャ https://aws.amazon.com/jp/builders-flash/202301/lambda-web-adapter/ 3. Lambda Web Adaptor
JavaScript × AWS Lambdaの新常識 1. TypeScript × AWS CDK 2.
LLRT 3. Lambda Web Adaptor 4. Response Streaming
4. Response Streaming • 2024年時点で、世はLLM時代 ◦ つまり「ヌルヌル返却するやつ」時代ということ(?) • Lambda Response
Streaming ◦ FunctionsURLから、ペイロードをStreamingで返せる ◦ 最大20MB返せる(通常6MB)
4. Response Streaming 制約:動作条件 1.マネージドランタイム ◦ Node.js v16以降”のみ” 2.カスタムランタイムに実装 ◦
実装済はRust Runtime for AWS Lambdaのみ? 3.+ Lambda Extensions ◦ 後述のLambda Web Adaptorを使うと間接的に2.相当
4. Response Streaming Node.js Runtimeには、組み込みの独自関数が用意 https://aws.amazon.com/jp/blogs/news/introducing-aws-lambda-response-streaming/
4. Response Streaming Appendix. 組み込み関数は少し癖がある • 実装前に、↓のスライドを読むのがおススメ https://speakerdeck.com/watany/aws-lambda-response-streaming-shi-zhuang-qian-nisiritaiyatu
まとめ
まとめ • JS/TS × LambdaとCDKとで、技術スタックを統一しやすい • StreamingもNode.jsランタイムなら始めやすい • Lambda Web
AdaptorでJSの強力なWeb Flameworkを採用できる • LLRTが実用化されれば更なる最適化へ…! だから JavaScript × AWS Lambdaがアツい!!