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
Real World Serverless
Search
freee
January 17, 2017
Technology
0
7k
Real World Serverless
freeeでのAWS Lambdaを利用したServerlessの活用方法
アーキテクチャの紹介やリージョンをまたいだ際の注意点など
from nasa
freee
January 17, 2017
Tweet
Share
More Decks by freee
See All by freee
巨大なテーブルのテーブル定義を無停止で安全に誰でも変更できるようにする / Table-definitions-for-huge-tables-can-be-modified-by-anyone-safely-and-non-disruptively
freee
1
760
合理的配慮を知るワークショップ/Understanding Reasonable Accommodations (Workshop)
freee
0
1.4k
10分でわかるfreeeのQA
freee
0
700
10分でわかるfreeeのPdM
freee
0
7.8k
freee + Product Design FY24 Q3
freee
3
7.4k
freeeAPI × Postman APIコラボレーションで スモールビジネスを世界の主役に! / FreeeAPI x Postman API collaboration to make small business the world's leading actor!
freee
0
3.1k
モバイルチームについて
freee
0
1.2k
GitHub Copilot 導入時に考えたセキュリティのあれこれ / Security-considerations-when-introducing-GitHub-Copilot
freee
3
6.2k
課金基盤開発エンジニアについて
freee
0
410
Other Decks in Technology
See All in Technology
アクセス制御にまつわる改善 / Improving access control
itkq
0
490
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
170
4年前、あるじゃん老害エンジニアLT合戦に登壇、米国西海岸コンピュータ歴史博物館体験記の続編
toshi_atsumi
0
220
プロデザ! BY リクルート vol.18_リクルートのリサーチ実践組織「リサーチブーストコミュニティ」
recruitengineers
PRO
3
270
On Your Data を超えていく!
hirotomotaguchi
2
630
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
170
オーナーシップを持つ領域を明確にする
konifar
13
3k
ユーザーストーリーのレビューを自動化したみたの
bun913
1
390
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
460
ServiceNow Knowledge Learning Rise up
manarobot
0
190
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
150
VS CodeでAWSを操作しよう
smt7174
7
1.6k
Featured
See All Featured
The Mythical Team-Month
searls
215
42k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
30
6k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
119
39k
Bash Introduction
62gerente
604
210k
Statistics for Hackers
jakevdp
789
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
GitHub's CSS Performance
jonrohan
1024
450k
Building Applications with DynamoDB
mza
88
5.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
Transcript
Real World Serverless nasa @ freee 2017.1.17 Serverless Meetup Tokyo#2
1
はじめまして • nasa (Asaoka Natsuki) • 紅茶, ガジェット, fedora 好き
• 2014 年から で engineer • その前はとある public cloud (IaaS) の開発を していました 2
3 freee にレシート・請求書のメールを転送 freee への登録部分に AWS Lambda を使用 PDF OCRにかけて
会計情報をつくるよ! 2016/11 freee Meets Serverless!!
recipe • AWS SES - メール受信 • AWS Lambda -
node.js • AWS DynamoDB • AWS S3 • apex • lambda local 4
email Amazon SES Amazon S3 Amazon S3 Amazon Lambda Amazon
Lambda Amazon DynamoD B oregon Tokyo 5 architecture
key point #1 • independent • 不正なメールが大量にきたとき、サービスへの大量アクセスを防 ぎたい • DynamoDB
で処理対象かcheck • 対象外なら exit • 障害時の復旧のしやすさ • S3 にデータがあればそれを使って再開 6 6 
key point #2 • retriable • 意図しないタイミングで retry されうる •
「実行時間 timeout」「memory 不足」etc. • retry を前提としたコード • 完了してる処理は skip • 復帰できない error は 通知して exit 7 7 
Extra • AWS の仕様を踏まえて試行錯誤 • “いつリージョンを超えるか ?” • SES は
Oregon, サービスは Tokyo • SES のイベントソースを使うと Lambda <-> S3, Lambda <-> freee 間で太平洋を越えることに…timeout の可能性Up • SES -> S3 でリージョン超え • Lambda は S3 のイベントソースを使う 8 8 
9 End We are hiring!
• apex • http://apex.run/ • lambda local • https://github.com/ashiina/lambda-local •
Understanding Container Reuse in AWS Lambda • https://aws.amazon.com/jp/blogs/compute/container-reuse-i n-lambda/ • 2016年11月度 新機能のお知らせ (※今回の機能のリリース告知) • https://www.freee.co.jp/blog/release-2016-11-30-18058.html 10 appendix