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.8k
小さく始めるクラウドネイティブ/small start CloudNative
petitviolet
0
1.7k
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
610
GraphQL on Scala
petitviolet
3
2.6k
Web API Design
petitviolet
18
8.1k
Property Based Testing introduction
petitviolet
1
110
Other Decks in Programming
See All in Programming
RubyLSPのマルチバイト文字対応
notfounds
0
120
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.2k
Jakarta EE meets AI
ivargrimstad
0
620
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
200
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
Remix on Hono on Cloudflare Workers
yusukebe
1
300
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Agile that works and the tools we love
rasmusluckow
327
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Become a Pro
speakerdeck
PRO
25
5k
Designing Experiences People Love
moore
138
23k
Designing for Performance
lara
604
68k
Code Reviewing Like a Champion
maltzj
520
39k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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&Ͱಈ͔͢ͱͤʹͳΕΔ