Movatterモバイル変換
[0]
ホーム
URL:
画像なし
夜間モード
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
watany
June 27, 2024
Technology
3
580
新常識! Javascript×AWS Lambdaがアツい!!
color is クラウドLT大会vol.9 で発表させていただいた内容になります。
https://saison-coloris.connpass.com/event/320707/
watany
June 27, 2024
Tweet
Share
More Decks by watany
See All by watany
AIエージェントが書くのなら直接CloudFormationを書かせればいいじゃないですか何故AWS CDKを使う必要があるのさ
watany
18
7.6k
Coding Agentに値札を付けろ
watany
3
830
Vibe Codingをせずに Clineを使っている
watany
19
7.5k
ミリしらMCP勉強会
watany
4
970
RemovalPoliciesのことを知ろう!
watany
2
140
エンジニアに許された特別な時間の終わり
watany
101
180k
AI Agent時代なのでAWSのLLMs.txtが欲しい!
watany
4
1.2k
宇宙最速のランチRecap LT会(AWS re:Invent 2024)
watany
2
760
苦いビールを避ける冴えたやり方
watany
2
420
Other Decks in Technology
See All in Technology
組織内、組織間の資産保護に必要なアイデンティティ基盤と関連技術の最新動向
fujie
0
270
How Do I Contact Jetblue Airlines® Reservation Number: Fast Support Guide
thejetblueairhelpsupport
0
150
三視点LLMによる複数観点レビュー
mhlyc
0
220
United™️ Airlines®️ Customer®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedguide
0
800
Microsoft Defender XDRで疲弊しないためのインシデント対応
sophiakunii
1
310
Rethinking Incident Response: Context-Aware AI in Practice
rrreeeyyy
2
940
Delegating the chores of authenticating users to Keycloak
ahus1
0
190
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.7k
Copilot coding agentにベットしたいCTOが開発組織で取り組んだこと / GitHub Copilot coding agent in Team
tnir
0
190
公開初日に Gemini CLI を試した話や FFmpeg と組み合わせてみた話など / Gemini CLI 初学者勉強会(#AI道場)
you
PRO
0
1.3k
american aa airlines®️ USA Contact Numbers: Complete 2025 Support Guide
aaguide
0
500
ゼロから始めるSREの事業貢献 - 生成AI時代のSRE成長戦略と実践 / Starting SRE from Day One
shinyorke
PRO
0
110
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Embracing the Ebb and Flow
colly
86
4.8k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Agile that works and the tools we love
rasmusluckow
329
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
282
13k
The Cost Of JavaScript in 2023
addyosmani
51
8.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
108
19k
For a Future-Friendly Web
brad_frost
179
9.8k
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がアツい!!
[8]
ページ先頭
©2009-2025
Movatter.jp