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
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.8k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
4
640
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.4k
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
Jakarta EE meets AI
ivargrimstad
0
580
RubyLSPのマルチバイト文字対応
notfounds
0
120
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
310
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A Tale of Four Properties
chriscoyier
156
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Happy Clients
brianwarren
98
6.7k
Gamification - CAS2011
davidbonilla
80
5k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Optimizing for Happiness
mojombo
376
70k
What's in a price? How to price your products and services
michaelherold
243
12k
Music & Morning Musume
bryan
46
6.2k
Making Projects Easy
brettharned
115
5.9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
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&Ͱಈ͔͢ͱͤʹͳΕΔ