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
IoTをServerless風にテストしたい!
Search
Keita Mohri
August 22, 2018
Technology
1
1.5k
IoTをServerless風にテストしたい!
Serverless Meetup Fukuoka #2
Keita Mohri
August 22, 2018
Tweet
Share
More Decks by Keita Mohri
See All by Keita Mohri
Excelを扱うRubyGemまとめ 2022
ktam1219
0
530
モクえもんのお時間です
ktam1219
0
160
在宅ワーク中だけど会社にしかGPSマルチユニットがない?でも大丈夫!そう、mockmockがあればね。
ktam1219
0
370
IoTデバイスの疑似データ送信システムにおける サーバーレスなログ処理機構の試行錯誤
ktam1219
0
530
実写版モクえもん in Explorer ~愛・おぼえていますか~
ktam1219
0
280
エンジニアのおしごと
ktam1219
0
110
mockmockの大量のログをいい感じに捌きたい
ktam1219
0
950
Goで作る大量プロセス管理機構
ktam1219
2
3.2k
わりとゴツいKubernetesハンズオン そのあとに
ktam1219
0
580
Other Decks in Technology
See All in Technology
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
630
Aurora_BlueGreenDeploymentsやってみた
tsukasa_ishimaru
1
120
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
150
クライアントサイドでよく使われる Debounce処理 をサーバサイドで3回実装した話
yoshiori
1
140
バクラクにおける可観測性向上の取り組み
yuu26
3
400
大規模データ基盤チームのオンプレTiDB運用への挑戦 / dpu-tidb
cyberagentdevelopers
PRO
1
110
一休.comレストランにおけるRustの活用
kymmt90
3
580
コンテンツを支える 若手ゲームクリエイターの アートディレクションの事例紹介 / cagamefi-game
cyberagentdevelopers
PRO
1
120
最速最小からはじめるデータプロダクト / Data Product MVP
amaotone
5
720
【LT】ソフトウェア産業は進化しているのか? -Javaの想い出とともに- #jjug_ccc
takabow
0
170
Automated Promptingを目指すその前に / Before we can aim for Automated Prompting
rkaga
0
110
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
38
7k
Embracing the Ebb and Flow
colly
84
4.4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
It's Worth the Effort
3n
183
27k
What's new in Ruby 2.0
geeforr
342
31k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
How STYLIGHT went responsive
nonsquared
95
5.2k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Become a Pro
speakerdeck
PRO
24
5k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Six Lessons from altMBA
skipperchong
26
3.5k
Transcript
*P5Λ 4FSWFSMFTT෩ʹςετ͍ͨ͠ʂ ໟརܒଠ 4FSWFSMFTT.FFUVQ'VLVPLB
ࣗݾհ ໟརܒଠʢ͏Γ͚͍ͨʣ 'VTJD$P -UE ൃҊऀϓϩμΫτΦʔφʔ *P5ܥͷडୗҊ݅
લ৬ ༯ոͱ͔Ͱ༗໊ͳ ήʔϜձࣾ
ࣗݾհ IUUQTRJJUBDPN,UB.JUFNTBGBBCC IUUQTHJUIVCDPN,UB.[BSV ϝʔϧʹύεϫʔυ͖[JQΛఴͯ͠ʮύεϫʔυผ్͓ૹΓ͍ͨ͠·͢ʯ ͱ͢Δ׳श͕ΊΜͲ͍͘͞ͷͰͳΜͱ͔ͨ͠ 4FSWFSMFTTతͳաڈ࡞
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT ‣ *P5ͱςετ ‣ *P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱ4FSWFSMFTT
*P5ݩ *P5ݩɹ *P5ݩɹ *P5ݩɹ *P5ݩɹ ݕࡧ ݕࡧ ݕࡧ ݕࡧ
*P5ݩ *P5ݩɹ ݕࡧ ͳ͠ ‣ ͕࣌ਐΈ࢝Ί͍ͯΔ ‣ *P5ͷ͍߹Θͤ૿͖͑ͯͨ ‣ 1P$͔Βຊ։ൃͷҠߦ૿͖͑ͯͨ
‣ େنͳ*P5։ൃ͕૿͖͍͑ͯͯΔʂ
4FSWFSMFTTͰ͋ͬͯ͘Ε ࠓͲ͖4FSWFSMFTT͡Όͳ͍ͱ ࢮΜͰ͠·͏ Backend Sensor/Device
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ ো͕ى͖ͨΑʂ PS ϝϯςͯ͠Ͷʂ
োϝϯςʹରͯ͠ແ࣊൵
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ ࠓௐࢠ͕͍͍͔Β ͨ͘͞ΜૹΔΑʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device Ұؾʹ ૿͢Αʂ ࠓௐࢠ͕͍͍͔Β ͨ͘͞ΜૹΔΑʂ ϜϦϜϦϜϦ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ϜϦϜϦϜϦ ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ
͠4FSWFSNPSF ͩͬͨΒʜ Backend Sensor/Device ϜϦϜϦϜϦ ແ࣊൵ʹσʔλΛ ૹΓଓ͚ΔΑʂ
εέʔϧʹରͯ͠ແ࣊൵
*P5ͷσʔλϩετ͔ͳΓࠔΔ ‣ औΓͤͳ͍ ਓؒ૬खͱҧͬͯʮ͏Ұૹͬͯʯ͕Ͱ͖ͳ͍ ͜ͱ͕ଟ͍ ‣ ࣌ܥྻͰҙຯ͕͋Δ
ͷมಈΛάϥϑͰݟ͔ͨͬͨΓ σʔλʹԠͯ͡εςʔλε͕มΘΔͷͩͬͨΓ ‣ ॏཁͳҙຯΛ࣋ͭσʔλͷ߹ ΞϥʔτͷτϦΨʔʹͳΔΑ͏ͳͷͩͬͨΒେม
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ϝϯςདྷͳ͍Ͱʂ
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ 4FSWFSMFTTͷแ༰ྗ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ো ΄΅ ͳ͠ εέʔϧ͕ಘҙ ͳͷ͕ଟ͍
ϝϯςདྷͳ͍Ͱʂ ϝϯς ͨͿΜ ͳ͠
*P5ͱ4FSWFSMFTT *P5ͷ൵௧ͳڣͼ 4FSWFSMFTTͷแ༰ྗ োى͖ͳ͍Ͱʂ ͍͍ײ͡ʹεέʔϧͯ͠ʂ ো ΄΅ ͳ͠ εέʔϧ͕ಘҙ ͳͷ͕ଟ͍
ϝϯςདྷͳ͍Ͱʂ ϝϯς ͨͿΜ ͳ͠
"84ᐌ͘ IUUQTXXXTMJEFTIBSFOFU"NB[PO8FC4FSWJDFT+BQBOBXTCMBDLCFMUPOMJOFTFNJOBSJPU "84#MBDL#FMU0OMJOF4FNJOBS*P5͚࠷৽ΞʔΩςΫνϟύλʔϯ
"[VSFᐌ͘ IUUQTBLBNTJPUSFGBSDIJUFDUVSF "[VSF*P53FGFSFODF"SDIJUFDUVSF(VJEF
($1ᐌ͘ IUUQTXXXZPVUVCFDPNXBUDI WLQ&U92BL "OPWFSWJFXPG$MPVE*P5$PSF (PPHMF*0
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ‣ *P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱςετ
*P5ͷςετ͕ΓͮΒ͍ ͪΌΜͱςετ͠Α͏ͱ͢Δͱ ͱͯΓͮΒ͍ Backend Sensor/Device
*P5ͷςετ͕ΓͮΒ͍ σʔλ͕དྷͳ͍ͱಈ͔ͳ͍ Backend Sensor/Device D a t a
*P5ͷςετ͕ΓͮΒ͍ ςετʹඞཁͳσʔλΛ Ͳ͔͜Βௐୡ͠Α͏ʁ Backend Sensor/Device D a t a
*P5ͷςετ͕ΓͮΒ͍ ͦͷ··࣮σόΠε͔Β σʔλΛૹΖ͏ Backend Sensor/Device D a t a
࣮σόΠε͔ΒૹΔ࡞ઓ ‣ ௐୡ ͔ͳΓ͕͔͔࣌ؒΔ ࣗࣾ։ൃ ηϯαʔͷબఆɾઃܭɾ࣮ͳͲ PSطͷߪೖ ‣
ॳظίετ ͋ͨΓͦΕͳΓͷඅ༻͕͔͔Δ ςετతͰ५ʹ༻ҙ͢Δͷඇݱ࣮త ‣ धཁʹԠͨ͡εέʔϧ ͪΖΜ͠ͳ͍
͓ʜ
͜ΕҎલզʑ͕ܾผΛਤͬͨ ʮΦϯϓϨʯతͳͭͰʁ
*P5ͷςετ͕ΓͮΒ͍ ͳΒγϛϡϨʔλʔΛ࡞ͬͯ ૹͬͯ͋͛Α͏ Backend Simulator D a t a
γϛϡϨʔλʔ͔ΒૹΔ࡞ઓ ‣ αʔόʔͷ͓ੈ Ͳ͔͜͠Βͷαʔόʔ খنͳΒϩʔΧϧʁ ͔ΒૹΒͳ͚Ε αʔόʔͷઃఆͱ͔͍Ζ͍Ζେม ‣
ΖΖಠ࣮ࣗ #BDLFOEͷଓɾೝূ ૹΔσʔλͷதσόΠεͷঢ়ଶભҠ੍ޚ Քಇঢ়گͷࢹ େྔՔಇ࣌ͷεέʔϧ ‣ ςετ༻σʔλ͕ཉ͍͚ͩ͠ͳͷʹ࡞ۀྔ͕ଟ͗͢Δ
͓ʜ
͜ΕҎલզʑ͕ܾผΛਤͬͨ ʮαʔόʔʯతͳͭͰʁ
4FSWFSMFTTతʹղܾ͠Α͏ σόΠεͷ'VODUJPOBM4BB4 Ͱ͖ͳ͍ͷ͔ʜ Backend Functional Saas? D a t a
͜Μͳײ͡ ‣ ඞཁͳͱ͖ʹ͙͢ʹௐୡͰ͖Δ ‣ αʔόʔͷଘࡏΛҙࣝͤͣʹඞཁͳ͚ͩՔಇͰ͖Δ ‣ ඞཁͳσʔλΛૹΔ͜ͱ͚ͩʹूதͰ͖Δ ‣ ϓϩάϥϜͰىಈఀࢭ੍͕ޚͰ͖Δ
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ී௨ʹΔͱπϥ͍ɻ'VODUJPOBM4BB4ͳσόΠε͕΄͍͠ʂ ‣
*P5ͱ4FSWFSMFTTͱςετͱ
*P5ͱ4FSWFSMFTTͱςετͱ
*P5ςετ༻ԾσόΠε࡞αʔϏε ੈքॳʂ
NPDLNPDLͱʁ σόΠεʹΘͬͯ ςετ༻σʔλΛૹΔԾσόΠε Backend D a t a
ಈ࡞֓ཁ Backend ίϯιʔϧͰઃఆΛߦͳ͏ σʔλૹ৴ઌ ϓϩτίϧ σʔλੜํ๏ͷઃఆ
ঢ়ଶભҠͷઃఆ FUDʜ
ಈ࡞֓ཁ Backend NPDLΛͭ͘Δ
ಈ࡞֓ཁ Backend D a t a NPDLΛಈ͔͢
None
ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)551)5514 ɹ.255.2554 ɹ"NB[PO8FC4FSWJDFT ɹɹɹ"84*P5$PSF
ɹ)5514.2554 ɹɹɹ"NB[PO,JOFTJT%BUB4USFBNT ɹ ɹ(PPHMF$MPVE1MBUGPSN ɹɹɹ$MPVE*P5$PSF ɹ.2554 ɹ.JDSPTPGU"[VSF ɹɹɹ"[VSF*P5)VC ɹ.2554 ".214 ɹ403"$0. ɹɹɹ403"$0.1MBUGPSN ɹɹɹ#FBN'VOOFM)BSWFTU ۙϦϦʔε ɹ ɹͦͷଞ ɹ͓ؾܰʹ͝૬ஊ͍ͩ͘͞
ରԠϓϩτίϧɾ࿈ܞαʔϏε ɹϓϥοτϑΥʔϜ ɹαʔϏε ɹϓϩτίϧ ɹಠࣗαʔόʔ ɹ ɹ)551)5514 ɹ.255.2554 ɹ"NB[PO8FC4FSWJDFT ɹɹɹ"84*P5$PSF
ɹ)5514.2554 ɹɹɹ"NB[PO,JOFTJT%BUB4USFBNT ɹ ɹ(PPHMF$MPVE1MBUGPSN ɹɹɹ$MPVE*P5$PSF ɹ.2554 ɹ.JDSPTPGU"[VSF ɹɹɹ"[VSF*P5)VC ɹ.2554 ".214 ɹ403"$0. ɹɹɹ403"$0.1MBUGPSN ɹɹɹ#FBN'VOOFM)BSWFTU ۙϦϦʔε ɹ ɹͦͷଞ ɹ͓ؾܰʹ͝૬ஊ͍ͩ͘͞ 4FSWFSMFTTͳ*P5#BDLFOEʹରԠʂ
"MM4FSWFSMFTT Backend D a t a 'VODUJPOBM4BB4 'VODUJPOBM4BB4 'BB4
͜͜·Ͱ͘Ε *P5ͷ&&ςετ͕ $*ͰͰ͖Δʂ
"84ͰͬͯΈͨ Thermometer Amazon Kinesis Data Streams AWS Lambda Amazon DynamoDB
{ "serial_number": "mk-00001", "timestamp": "2018-08-21T07:09:05Z", "temperatures": [ "22.8", "21.9" ] } ఆظతʹσʔλऔಘ ݅ͣͭ1VU |serial_number|timestamp |temperature01|temperature02|created_at | |-------------|-------------------|-------------|-------------|-------------------| |mk-00001 |2018/08/21 07:09:05|23.8 |25.4 |2018/08/21 07:09:06| |mk-00002 |2018/08/21 07:09:05|23.2 |24.0 |2018/08/21 07:09:06| |mk-00001 |2018/08/21 07:09:15|24.1 |25.6 |2018/08/21 07:09:17| |mk-00002 |2018/08/21 07:09:15|23.8 |24.4 |2018/08/21 07:09:18| |mk-00001 |2018/08/21 07:09:25|24.3 |25.0 |2018/08/21 07:09:26| |mk-00002 |2018/08/21 07:09:25|24.0 |23.9 |2018/08/21 07:09:27| ςετରͷΞϓϦέʔγϣϯ
σϞ
"84ͰͬͯΈͨ ᶃίʔυΛ1VTI
"84ͰͬͯΈͨ ᶃίʔυΛ1VTI ᶄ$*ىಈ
"84ͰͬͯΈͨ AWS Batch ᶃίʔυΛ1VTI ᶄ$*ىಈ ᶅ"84#BUDIͷ +PCΛૹ৴ ཧԼͷίϯϐϡʔςΟϯάڥ &$ ্Ͱ+PCΛ࣮ߦ͢Δ
&$࣮ߦ͢Δ+PCͷྔʹԠͯࣗ͡ಈͰ૿ݮͯ͘͠ΕΔ +PCίϯςφΛ࣮ͬͯߦ͢Δ େʹͬ͘͟Γݴ͑࣌ؒՔಇ͕Մೳͳ-BNCEB
"84ͰͬͯΈͨ AWS Batch EC2 instance ᶃίʔυΛ1VTI ᶄ$*ىಈ ᶅ"84#BUDIͷ +PCΛૹ৴ ᶆίϯϐϡʔςΟϯά
ڥ࡞
"84ͰͬͯΈͨ AWS Batch EC2 instance Amazon ECR Container ᶃίʔυΛ1VTI ᶄ$*ىಈ
ᶅ"84#BUDIͷ +PCΛૹ৴ ᶆίϯϐϡʔςΟϯά ڥ࡞ ᶇίϯςφىಈ
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script #!/bin/bash
git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh ᶊNPDLىಈ"1* Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container ᶈ$MPOF AWS SAM Test Script Amazon
Kinesis Data Streams AWS Lambda Amazon DynamoDB ᶉ%FQMPZ #!/bin/bash git clone $CODE_REPO $CODE_DIR cd $CODE_DIR sh test/batch/run.sh ᶊNPDLىಈ"1* ᶋςετσʔλૹ৴ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack ᶏ$POUBJOFSऴྃ
"84ͰͬͯΈͨ EC2 instance Container AWS SAM Test Script Amazon Kinesis
Data Streams AWS Lambda Amazon DynamoDB ᶌͨ·ͬͨσʔλΛूܭ ᶍ4MBDLʹ݁ՌΛ௨ ᶎ4UBDLΛআ Cloudformation Stack ᶏ$POUBJOFSऴྃ ᶐίϯϐϡʔςΟϯάڥআ
"84ͰͬͯΈͨ ‣ ຊ൪ڥͱશ͘ಉ͡ڥͰςετ͕Ͱ͖Δ ‣ ςετڥཱ͕ͭͷςετͷͱ͖͚ͩ ‣ "84#BUDIΛ͍ͬͯΔͷͰ$JSDMF$*͙͢ʹख์ͤΔ ࣌ؒɺɺिؒ୯ҐͷΤΠδϯάςετͰݱ࣮తʹՄೳ
ຊͷ͓ ‣ *P5ͱ4FSWFSMFTT *P5ͷ#BDLFOE4FSWFSMFTTͰΩϚϦʂ ‣ *P5ͱςετ ී௨ʹΔͱπϥ͍ɻ'VODUJPOBM4BB4ͳσόΠε͕΄͍͠ʂ ‣
*P5ͱ4FSWFSMFTTͱςετͱ Λ͏͜ͱͰ"MM4FSWFSMFTTʹʂ$*ճͤΔʂʂ
ͷ͜Ε͔Β ‣ ͱΓ͋͑ͣ"1*ΛϦϦʔε͢Δ ϦϦʔεͨ͠Βࠓճͷ$*͕Ͱ͖·͢ ‣ ૹ৴ͨ͠σʔλΛऔಘͰ͖ΔΑ͏ʹ͢Δʂ ཷ·ͬͨσʔλͱಥ͖߹ΘͤͨΓͰ͖ͯɺςετͷ෯͕͕Δ
·ͱΊ
ຊͷ͓ ‣ *P5ͷ#BDLFOE4FSWFSMFTT͕ελϯμʔυ ‣ *P5ͷςετී௨ʹΔͱπϥ͍ ‣ Λ͏͜ͱͰ"MM4FSWFSMFTTͰςετ͕Մೳʹ ‣ ͦͷ͍ʹͬͯ$*ճͨ͠ʂ
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ IUUQTNPDLNPDLDPNKB