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
Microservices Batch on GAE
Search
petitviolet
March 27, 2018
Programming
0
1.9k
Microservices Batch on GAE
Implement microservices architecture batch Scala program on Google AppEngine Standard Environment.
petitviolet
March 27, 2018
Tweet
Share
More Decks by petitviolet
See All by petitviolet
Stripeで請求書払い&銀行振込を実装する
petitviolet
0
1.2k
ピュアなドメインを支える技術/pure domain model and the technology behind it
petitviolet
14
9.9k
小さく始めるクラウドネイティブ/small start CloudNative
petitviolet
0
1.8k
2019年だからこそ12factor app/The Twelve-Factor app in 2019
petitviolet
1
970
実践GraphQL on Scala/Real world GraphQL on Scala
petitviolet
8
2.9k
Kubernetesを知る/Introduction Kubernertes
petitviolet
1
620
GraphQL on Scala
petitviolet
3
2.6k
Web API Design
petitviolet
18
8.2k
Property Based Testing introduction
petitviolet
1
110
Other Decks in Programming
See All in Programming
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
Jakarta EE meets AI
ivargrimstad
0
250
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
MCP with Cloudflare Workers
yusukebe
2
220
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
良いユニットテストを書こう
mototakatsu
8
2.5k
42 best practices for Symfony, a decade later
tucksaun
1
180
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.1k
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Featured
See All Featured
Making Projects Easy
brettharned
116
5.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
How GitHub (no longer) Works
holman
311
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Typedesign – Prime Four
hannesfritz
40
2.4k
Unsuck your backbone
ammeep
669
57k
Statistics for Hackers
jakevdp
796
220k
Building Your Own Lightsaber
phodgson
103
6.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Transcript
("&Ͱ.JDSPTFSWJDFTͳόον 'SJOHF$P -UE )JSPLJ,PNVSBTBLJ!QFUJUWJPMFU
ࣗݾհ w খࢵ߂و )JSPLJ,PNVSBTBLJ w ΠϯλʔωοτͰ!QFUJUWJPMFU w αʔόαΠυΤϯδχΞ! w
͜ͷ͘Β͍͍͍ͩͨ4DBMBॻ͍ͯΔ
͜ͷลͷͰ͢
ࠓ͢͜ͱ͞ͳ͍͜ͱ ͢͜ͱ w ("& 5BTL2VFVF 4DBMBͰόονΛ࡞Δ w ओʹΞʔΩςΫνϟతͳઓུ ͞ͳ͍͜ͱ w
("& 5BTL2VFVFͷࡉ͔͍ w 4DBMBͷ࣮ςΫχοΫ
ࠓ͢͜ͱ͞ͳ͍͜ͱ ͢͜ͱ w ("& 5BTL2VFVF 4DBMBͰόονΛ࡞Δ w ओʹΞʔΩςΫνϟతͳઓུ ͞ͳ͍͜ͱ w
("& 5BTL2VFVFͷࡉ͔͍ w 4DBMBͷ࣮ςΫχοΫ
όονʁ
όονʁ ϓϩάϥϜ܈Λॲཧత͝ͱʹ۠Γɺ͜ͷ۠ Γຖʹॱ࣮࣍ߦͯ͠Ώ͘ॲཧͷ͜ͱ XJLJQFEJB ཁ͢ΔʹɺԿ͔͠ΒͷॲཧΛॱ࣮࣍ߦ͢Δ͜ͱ
όονͷ͋Δ͋Δ Α͋͘Δ݅ҎԼͷΑ͏ͳͷ w ఆظ࣮ߦ DSPO w σʔλΛཷΊͯ·ͱΊͯॲཧ w FUD
όονͷΘ͕·· w ىಈ࣌Ҏ֎͓͔͚ۚͨ͘ͳ͍ w ίέͨΒࣗಈͰϦτϥΠ͍ͨ͠ w σʔλ͕૿͑ͨΒΦʔτεέʔϧ͍ͤͨ͞
ͦΕɺ("&Ͱग़དྷΔΑ
("& w (PPHMF"QQ&OHJOF w ͍ΘΏΔ1BB4 w \4UBOEBSE 'MFYJCMF^&OWJSPONFOUͷछྨ w 4&੍ݶ͕ݫ͍͕͠ӡ༻͓ͤ
w '&੍ݶ͕؇͍͕ӡ༻खಈ
("& ϑϨΩγϒϧڥɺελϯμʔυڥΛิ͢ Δ͜ͱΛతͱ͍ͯ͠·͢ɻ IUUQTDMPVEHPPHMFDPNBQQFOHJOFEPDTqFYJCMFKBWBqFYJCMFGPSTUBOEBSEVTFST IMKB جຊ4&Λݕ౼͠ɺμϝͬΆ͍ͳΒ'&ʹ͢Δ
("& ϑϨΩγϒϧڥɺελϯμʔυڥΛิ͢ Δ͜ͱΛతͱ͍ͯ͠·͢ɻ IUUQTDMPVEHPPHMFDPNBQQFOHJOFEPDTqFYJCMFKBWBqFYJCMFGPSTUBOEBSEVTFST IMKB جຊ4&Λݕ౼͠ɺμϝͬΆ͍ͳΒ'&ʹ͢Δ ΠϯελϯελΠϓͰεέʔϧઓུΛม͑ΒΕΔ w BVUPNBUJDҰ൪͓ͤͰ("&ͬΆ͍ w
CBTJDόονͱ͔ w NBOVBMखӡ༻Ͱ*BB4دΓ
όονͷΘ͕·· w ىಈ࣌Ҏ֎͓͔͚ۚͨ͘ͳ͍ w ("&4&ͳΒ࣮ߦ࣌ؒ՝ۚ w ίέͨΒࣗಈͰϦτϥΠ͍ͨ͠ w w
σʔλ͕૿͑ͨΒΦʔτεέʔϧ͍ͤͨ͞ w
5BTL2VFVF
5BTL2VFVF w ("&ɺಛʹ4&Ͱ؆୯ʹ͑ΔδϣϒΩϡʔ w \1VTI 1VMM $SPO^Ωϡʔͷछྨ͋Δ w ("&αʔϏεؒͷ࿈ܞʹ1VTIΩϡʔ͕ඇৗʹศར w
DSPO͋ΔͷͰόονͷىಈ؆୯ w εςʔλε͕YYͱ͔ͳΒϦτϥΠͯ͘͠ΕΔ
5BTL2VFVF w ઃఆൺֱత୯७Ͱ؆୯ʹ࡞Մೳ w ͜Μͳײ͡ ˡϦτϥΠճͷ্ݶ ˡλεΫͷੜଘ࣌ؒ
όονͷΘ͕·· w ىಈ࣌Ҏ֎͓͔͚ۚͨ͘ͳ͍ w ("&4&ͳΒ࣮ߦ࣌ؒ՝ۚ w ίέͨΒࣗಈͰϦτϥΠ͍ͨ͠ w 5BTL2VFVFʹϦτϥΠػೳ͕͋Δ w
σʔλ͕૿͑ͨΒΦʔτεέʔϧ͍ͤͨ͞ w
όονͷΘ͕·· w ىಈ࣌Ҏ֎͓͔͚ۚͨ͘ͳ͍ w ("&4&ͳΒ࣮ߦ࣌ؒ՝ۚ w ίέͨΒࣗಈͰϦτϥΠ͍ͨ͠ w 5BTL2VFVFʹϦτϥΠػೳ͕͋Δ w
σʔλ͕૿͑ͨΒΦʔτεέʔϧ͍ͤͨ͞ w σʔλগ σʔλଟ
ΦʔτεέʔϧʹΉ͚ͯ w εέʔϧΞοϓ͍ͨ͠ w ("&ͩͱࣗಈͰग़དྷͳ͍ w εέʔϧΞτ͍ͨ͠ w ("&ϦΫΤετ૿ͰεέʔϧΞτ w
σʔλ͕૿͑ΔͱϦΫΤετ͕૿͑ΔΑ͏ ʹ࣮͢Δ
ΦʔτεέʔϧʹΉ͚ͯ w εέʔϧΞοϓ͍ͨ͠ w ("&ͩͱࣗಈͰग़དྷͳ͍ w εέʔϧΞτ͍ͨ͠ w ("&ϦΫΤετ૿ͰεέʔϧΞτ w
σʔλ͕૿͑ΔͱϦΫΤετ͕૿͑ΔΑ͏ ʹ࣮͢Δ
4DBMBͱ("&
4DBMBͱ("& w 'SJOHFͰαʔόαΠυ։ൃʹ4DBMBΛΑ͘͏ w ("&4&ͷ+BWBରԠ݄ w IUUQTDMPVEQMBUGPSNHPPHMFCMPHDPN+BWBPO"QQ&OHJOF4UBOEBSEFOWJSPONFOUJTOPXHFOFSBMMZBWBJMBCMFIUNM w 4&Ͱ+BWB͕ಈ͚4DBMBಈ͘ʂ
4DBMBͰόονॲཧ w 4DBMBඇಉظॲཧϧʔϓॲཧ͕هड़͘͢͠ɺ όονͰ͋Γ͕ͪͳॲཧΛ؆୯ʹॻ͚Δ w 'VUVSFͱ-JTUNBQͷΑ͏ͳ"1*Λ͏ val targets: List[Data] =
??? val resultFutures: List[Future[Result]] = targets map { target => Future { execute(target) } // 何か重い処理を非同期で実行 } val results: Future[List[Result]] = Future.sequence(resultFutures)
͜͜Ͱൃੜ w ("&4&γϯάϧίΞ w ඇಉظॲཧͷޮՌ͕ബ͍ w '&ʹͯ͠ϚϧνίΞʹ͢Δʜ
ίΞ͕Γͳ͚Ε ϚγϯΛ૿͍͍ͤ͡Όͳ͍
5BTL2VFVFΛͬͯίΞΛ૿͢ ϚϧνίΞγϯά ϧίΞ ϚϧνΠϯελϯε w ඇಉظॲཧΛλεΫͱͯ͠5BTL2VFVFQVU͢Δ w \ಉ͡ ผͷ^("&αʔϏεͰड͚औͬͯඇಉظॲཧ w
ϧʔϓॲཧҰͭͣͭผͷλεΫʹ͢Δ 5BTL2VFVF
େ͖ͳόονॲཧΛ খ͞ͳλεΫʹׂͯ͠ ඇಉظʹॲཧ͢Δ
·͞ʹ.JDSPTFSWJDFT
ͪͳΈʹ ("&4&ͩͱϝϞϦͷ࠷େαΠζ͕(#ͳͷͰɺ Լखʹେ͖ͳόονΛಈ͔͢ͱ؆୯ʹ00.͕ى ͖ΔͷͰɺόονΛখׂͤ͘͟͞ΔΛ͑ͳ͍ σʔλଟ
.JDSPTFSWJDFTͳόον όονॲཧΛׂͯ͠ޙଓͷॲཧ5BTL2VFVF Λͬͯܨ͙ 5BTL2VFVF ॲཧରͷ ҰཡΛऔಘ Ұͭͣͭ ॲཧ͢Δ ͞Βʹࡉ͔͘ ॲཧ͢Δ
ͪ߹Θͤͯ ΫϦʔϯΞοϓ ʜ ʜ
όονͷΘ͕·· w ىಈ࣌Ҏ֎͓͔͚ۚͨ͘ͳ͍ w ("&4&ͳΒ࣮ߦ࣌ؒ՝ۚ w ίέͨΒࣗಈͰϦτϥΠ͍ͨ͠ w 5BTL2VFVFʹϦτϥΠػೳ͕͋Δ w
σʔλ͕૿͑ͨΒΦʔτεέʔϧ͍ͤͨ͞ w ࡉ͔͘λεΫʹΓ͚ͯεέʔϧΞτ 5BTL2VFVF
·ͱΊ 4DBMBͰॻ͍ͨόονΛ ("&4&Ͱಈ͔͢ͱͤʹͳΕΔ