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
18
Serverless_meetup_AWS Application Composer_and_devtoops_update_JP
naotoiso
1
120
Other Decks in Programming
See All in Programming
Webフレームワークの ベンチマークについて
yusukebe
0
180
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
360
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
12
6.3k
さぁV100、メモリをお食べ・・・
nilpe
0
150
Oxcを導入して開発体験が向上した話
yug1224
4
340
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
180
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
2
720
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
180
ふつうのFeature Flag実践入門
irof
8
4.2k
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
130
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
470
Evolving SEO for Evolving Search Engines
ryanjones
0
220
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
BBQ
matthewcrist
89
10k
Optimizing for Happiness
mojombo
378
71k
HDC tutorial
michielstock
2
720
Done Done
chrislema
186
16k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
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]