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
re:Invent re:Cap / AWS StepFunctions Updates
Search
naotoiso
January 20, 2023
Programming
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
re:Invent re:Cap / AWS StepFunctions Updates
naotoiso
January 20, 2023
More Decks by naotoiso
See All by naotoiso
AWS_MCP_Servers入門.pdf
naotoiso
1
970
Amazon Rekognition で実現する 生体検出プロセス付き顔認証
naotoiso
0
19
Serverless_meetup_AWS Application Composer_and_devtoops_update_JP
naotoiso
1
120
Other Decks in Programming
See All in Programming
Performance Engineering for Everyone
elenatanasoiu
0
270
フィードバックで育てるAI開発
kotaminato
1
110
スマートグラスで並列バイブコーディング
hyshu
0
290
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
110
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
310
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
160
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
5.8k
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
110
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
350
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
170
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Faster Mobile Websites
deanohume
310
32k
The Curse of the Amulet
leimatthew05
2
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Optimising Largest Contentful Paint
csswizardry
37
3.8k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
Mobile First: as difficult as doing things right
swwweet
225
10k
Un-Boring Meetings
codingconduct
0
340
Transcript
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. re:Cap AWS Step Functions ~ AWS Step Functions Distribted Map ~ Naoto Oiso S E R V E R L E S S M E E T U P 2 0 2 3 . 0 1 . 1 8 Solutions Architect Amazon Web Services
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. ⾃⼰紹介 2
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. ⾃⼰紹介 • 名前 § オオイソ ナオト • 好きな⾷べもの § ⾁・寿司・ラーメン • 好きなこと § お酒・サウナ・マンガ・テニス・投資 • 好きなAWSサービス § AWS Application Composer・AWS Step Functions ・ Amazon EventBridge 3 Glue Code ※ を 減らしてくれる サービスが好き ※ Glue Codeとはコンピュータプログラミングにおいてプログラムの要求仕様の実現には一切寄与しないが、 もともと互換性がない部分同士を結合するためだけに働くコードである
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. はじめに 4
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Agenda 5 自己紹介 ~ 30秒 ~ はじめに ~ 30秒 ~ Step Functions とは ~ 30秒 ~ Step Functions の Distributed Mapとは ~ 5分 ~ デモ ~ 5分 ~
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Target 6 Step Functions Distributed Mapが発表されたことを知らない方! Step Functions Distributed Mapを、ただの従来のMap Stateの並列数上限変更だと思っている方!!
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Step Functions とは 7
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. AWS Step Functions とは AWS Step Functions はワークフローサービス 8 条件分岐 エラーハンドリング 繰り返し リトライ 順次処理 並列処理 ⼀連のプロセスやジョブやAWS サービス連携を、 ビジュアルやコードで管理・制御できる。
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. AWS Step Functions のユースケース 9 マイクロサービス オーケストレーション ML パイプライン 複雑なバッチ処理 軽量のETL シーケンシャルな実⾏制御、依存関係の複雑な処理の集合、 結果に応じた処理の分岐がある複数のタスクの管理に適している。 ⾃律的なメカニズムに基づいた⾃動処理が求められるシーン
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. AWS Step Functions の ワークフローパターン 10 Serverless Workflows patterns Automated policy orchestrator IAM Policy の承認フロー Query Athena S3 data ページネーション単位の処理 Concurrency Controller DynamoDB を利⽤した排他制御 SAM テンプレートの形式で⽤意されている
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Distributed Map とは 11
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. AWS Step Functions の Distributed Map とは ⼤規模な並列データ処理のためのサーバレスソリューション 12 Amazon S3 からの ⼤規模データ読み込み、書き戻し 従来の Map State に、 ※ クレーム チェックパターンの⾃動化と、 10,000 並列までの⼦ワークフローの⾃動⽣成 10,000 並列可能な ⼦ワークフローの⽣成 参照: AWS Serverless Claim Check Pattern
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 参考: Claim Check Pattern とは 効率的な⼤容量データの受け渡しの⼿法 13 サービス限度以上のデータを受け渡しすることが可能。 参照: AWS Serverless Claim Check Pattern ペイロード(データ) メッセージ 大規模ストレージ ペイロード(データ)
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 従来のMap Stateの課題 14 中・⼤規模な並列データ処理を⾏いたいときの従来のワークフローパターン AWS Step Functions workflow AWS Step Functions workflow データ整形 & クレーム チェック パターンの⾃前実装 中・⼤規模な処理では並列数不⾜。 Lambda 等で、別のワークフローを 実⾏するAPIを複数回呼び出し、擬 似的に40以上の並列を実現している ことも。 256KB 以上のペイロードは渡せない。 結果を S3 に取りに⾏き、 Reduce(集約) して S3 に書き戻す処理が必要 256KB 以上のペイロードは渡せない。 データを取得及び分割して、S3 に保存して、取っ てきて、それらのARNの配列を渡す処理が必要 ⾃前での並列ワークフローの⽣成
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Distributed Map による改善 15 中・⼤規模な並列データ処理を⾏いたいときの従来のワークフローパターン データ整形 & クレーム チェック パターンの⾃動化 並列処理のための⼦ワークフローの⾃動⽣成 最⼤10,000個の⼦ワークフ ローとして並列処理を実⾏ 実⾏結果を Reduce (集約)して S3 に書き戻してくれる S3のでオブジェクトのリストやデータを 直接読み込み、⾃動で分割してMap
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Distributed Map による改善 16 中・⼤規模な並列データ処理を⾏いたいときの従来のワークフローパターン データ整形 & クレーム チェック パターンの⾃動化 並列処理のための⼦ワークフローの⾃動⽣成 最⼤10,000個の⼦ワークフ ローとして並列処理を実⾏ 実⾏結果を Reduce (集約)して S3 に書き戻してくれる S3のでオブジェクトのリストやデータを 直接読み込み、⾃動で分割してMap
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. ⼊⼒時の分割及びクレームチェックパターンの⾃動化 S3のURIを指定することで、そこにあるデータを分割して読み込んでくれる 17 S3ソースの形式 1. フォルダ配下のオブジェクトリスト 2. JSON形式のオブジェクト 3. CSV形式のオブジェクト 4. S3 マニフェストファイルによるオ ブジェクトリスト
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Distributed Map による改善 18 中・⼤規模な並列データ処理を⾏いたいときの従来のワークフローパターン データ整形 & クレーム チェック パターンの⾃動化 並列処理のための⼦ワークフローの⾃動⽣成 最⼤10,000個の⼦ワークフ ローとして並列処理を実⾏ 実⾏結果を Reduce (集約)して S3 に書き戻してくれる S3のでオブジェクトのリストやデータを 直接読み込み、⾃動で分割してMap
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 並列ワークフロー実⾏の⾃動化 最⼤10,000個の⼦ワークフローを⾃動⽣成 19
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. Distributed Map による改善 20 中・⼤規模な並列データ処理を⾏いたいときの従来のワークフローパターン データ整形 & クレーム チェック パターンの⾃動化 並列処理のための⼦ワークフローの⾃動⽣成 最⼤10,000個の⼦ワークフ ローとして並列処理を実⾏ 実⾏結果を Reduce (集約)して S3 に書き戻してくれる S3のでオブジェクトのリストやデータを 直接読み込み、⾃動で分割してMap
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 出⼒時の集約及びクレームチェックパターンの⾃動化 ResultWriter : S3のURIを指定することで、データを集約して書き込んでくれる 21 フォルダのメタデータを表すmanifest.jsonと 結果ファイルであるSUCCEEDED_n.json、 FAILED_n.json、 PENDING_n.json を出力
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 参考:Distributed Map の State から出⼒されるデータ manifest.jsonのデータ構造 22 { "DestinationBucket": "choppiri-dd-demo1-sam-s3output-sample", "MapRunArn": "arn:aws:states:us-east- 1:151529226867:mapRun:MorphologicalAnalysis/DistributedMap:0379eb6d-96a6- 3ffb-8ee4-3807569d39e4", "ResultFiles": { "FAILED": [], "PENDING": [], "SUCCEEDED": [ { "Key": "result/0379eb6d-96a6-3ffb-8ee4- 3807569d39e4/SUCCEEDED_0.json", "Size": 45447813 } ] } }
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. 参考:Distributed Map の State から出⼒されるデータ Reduce(集約)されて出⼒されるSUCCEEDED_0.jsonのデータ構造 23 { "ExecutionArn": "arn:aws:states:us-east-1:アカウント番号:execution:choppiri-dd- demo/Map:44919aa8-8f3b-34fd-b155-459756f4f490", "Input": "{…}", "InputDetails": { "Included": true }, "Name": "44919aa8-8f3b-34fd-b155-459756f4f490", "Output": […]", "OutputDetails": { "Included": true }, "StartDate": "2023-01-04T04:36:11.470Z", “StateMachineArn”: “arn:aws:states:us-east-1:アカウント番号:stateMachine:choppiri- dd-demo/Map", "Status": "SUCCEEDED", "StopDate": "2023-01-04T04:36:11.616Z" }
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. まとめ: AWS Step Functions の Distributed Map とは ⼤規模な並列データ処理のためのサーバレスソリューション 29 Amazon S3 からの ⼤規模データ読み込み、書き戻し 従来の Map State に、 ※ クレーム チェックパターンの⾃動化と、 10,000 並列までの⼦ワークフローの⾃動⽣成 10,000 並列可能な ⼦ワークフローの⽣成 参照: AWS Serverless Claim Check Pattern
© 2023, Amazon Web Services, Inc. or its affiliates. All
rights reserved. Amazon Confidential and Trademark. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Thank you! Naoto Oiso
[email protected]