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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
170
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
330
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
140
継続モナドとリアクティブプログラミング
yukikurage
3
610
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
0
280
yield再入門 #phpcon
o0h
PRO
0
480
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.5k
Performance Engineering for Everyone
elenatanasoiu
0
270
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.8k
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
180
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
860
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
210
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.8k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.8k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
400
Building the Perfect Custom Keyboard
takai
2
810
Designing for Performance
lara
611
70k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
Rails Girls Zürich Keynote
gr2m
96
14k
So, you think you're a good person
axbom
PRO
2
2.1k
Crafting Experiences
bethany
1
220
YesSQL, Process and Tooling at Scale
rocio
174
15k
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]