Upload
Download free for 30 days
Login
Submit Search
201909 mediado.go 駆け出しGopherの初めてのバッチ設計で学んだこと
Download as PPTX, PDF
0 likes
698 views
K
Kojikensanba
LambdaとStep functionsでバッチ処理を作ってみた話
Technology
Read more
1 of 41
Download now
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
More Related Content
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
PPTX
PHPカンファレンス2012 LT 一億総PHPer計画
Yuki Okamoto
PDF
spc2016-31_電子書籍を買いたくなるプロモーション案
Kaigi Senden
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
PDF
Everything You Need To Know About ChatGPT
Expeed Software
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
PHPカンファレンス2012 LT 一億総PHPer計画
Yuki Okamoto
spc2016-31_電子書籍を買いたくなるプロモーション案
Kaigi Senden
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Expeed Software
Featured
(20)
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
PDF
Skeleton Culture Code
Skeleton Technologies
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
PDF
Getting into the tech field. what next
Tessa Mero
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
PDF
Introduction to Data Science
Christy Abraham Joy
PDF
Time Management & Productivity - Best Practices
Vit Horky
PDF
The six step guide to practical project management
MindGenius
PDF
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
PDF
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
PDF
12 Ways to Increase Your Influence at Work
GetSmarter
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
GetSmarter
Ad
201909 mediado.go 駆け出しGopherの初めてのバッチ設計で学んだこと
1.
駆け出しGopherの 初めてのバッチ設計で 学んだこと By こじけん
2.
自己紹介 小島健太郎(こじけん) ・株式会社メディアドゥ ・2019年新卒入社 ・電子書店コミなびの開発
3.
メディアドゥ ってなにしてるの?
4.
メディアドゥがやっていること 買う 電子書店ごとに 本の情報を提供 本の情報を提供 電子書店 電子書籍の取次
5.
メディアドゥも電子書店を運営している
6.
電子書店がやることは
7.
日々、新刊が発売されたり キャンペーンで本の価格が変わるので
8.
電子書店の持つDBの本情報を毎日更新する { book_id: 1 book_name: “ワンピース93巻” price:
400 thumbnail_path:“https://thumbnail_url” } サムネ画像はメディ アドゥ が用意して いる 1日多くて2000件
9.
問題
10.
問題 サムネ画像が重い
11.
つまり電子書店を運営するには
12.
バッチが必要
13.
AWS で実現したい
14.
考えられた選択肢 ・AWS Batch ・SQS +
Lambda ・Step Functions + Lambda
15.
AWS Batch
16.
バッチだし AWS Batch使えばなんとかなるっしょ
17.
AWS Batchの使い方間違ってます Solution Architect
18.
そもそもバッチの管理とは
19.
バッチジョブ管理システムは二種類ある ジョブのプロセスを制御 ジョブを複数リソースに割り当てる AWS Black
Belt Online Seminar 2017 AWS Batch より AWS Batchはこっち JobA JobB JobC JobA JobB JobAJobB キューイング
20.
SQS + Lambda
21.
SQS + Lambda 次に呼び出すLambdaをLambda自身で指定 しないといけない
22.
バッチ処理に使うLambdaたちを いっぺんに管理したいなー
23.
そこで
24.
Step Functions
25.
Step Functions 次に呼ぶリソース(Lambdaなど)の指定 、並行処理、エラー時の分岐処理など Step Functionsで定義できる (Lambdaのコード量も減少)
26.
JSON形式の言語でワークフローを定義 単一の処理を行うよ リソースはこれだよ 出力結果はこのキー で取得できるよ 次はこのステートの 処理を行ってね リトライはこんな感 じでやってね
27.
State Typeは7種類ある Task 単一の処理を行う Wait
指定した時間の間、処理をストップする Pass 入力をそのまま出力へ渡す Parallel 並列に処理を実行する Choice 一定の条件により分岐する Fail 実行結果を失敗として終了する Succeed 実行結果を成功として終了する
28.
料金 ステップが遷移した回数に対する課金 4000回/月まで無料 それ以降は 約2.7円/1000回 今回の条件だったら無料で使えそう
29.
Step Functionsで使えるサービス dynamoDB SNS ECS SQS Glue Lambda
Batch SageMaker
30.
ということで
31.
バッチを設計してみました
33.
バッチ処理のアーキテクチャ ◯秒待ってから
34.
Step Functionsのワークフロー
35.
百聞は一見にしかずということで
36.
Step Functionsを動かしてみます
37.
GoでLambdaを作っている時に はまったこと
38.
Goのバイナリに .envファイルが含まれない
39.
Goで作ったLambdaで環境変数を取得する方法 ・AWSコンソールで設定して、os.Getenv ・envファイルも含めてzipファイルを作ってgodotenv.Load() ・statik、packr等のアセットツールを使ってtmpFileにenvファイル の内容を出力し、godotenv.Load(tmpFile.Name()) バイナリファイル .env .envが入ったフ ォルダ box tmpFile Loadする box.Find()
40.
まとめ ・Step FunctionsとLambdaを組み合わせることで Lambdaを簡単に管理できる ・環境変数の扱いには注意
41.
ご清聴ありがとうございました
Download