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
じわじわとPerlからGoに移行しようとしている俺達のマイクロサービシーズの紹介 / The ...
Search
mackee
March 05, 2022
Programming
2
3k
じわじわとPerlからGoに移行しようとしている俺達のマイクロサービシーズの紹介 / The migrating to microservices in Go from Monolith in Perl
YAPC::Japan::Online 2022 Track B
mackee
March 05, 2022
Tweet
Share
More Decks by mackee
See All by mackee
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
78
perl for shell, awk and sed programmers
mackee
2
1.5k
今更GoのWebフレームワークを作ろうとしているワケ / Why am I trying to create a Go web framework now?
mackee
1
69
マイクロサービス化を利用した Goへの移行事例
mackee
0
120
PerlでつくるフルスクラッチWebAuthn/パスキー認証 / Demonstration of full-scratch WebAuthn/Passkey Authentication written in Perl
mackee
3
3.3k
SRE定例やその辺の取り組みをアプリケーションエンジニア目線で語る / "Observe" about SRE Meeting by Application Engineer
mackee
0
1.8k
TinyGoで使えるORM sqllaの 紹介とTinyGoで使えるようにするための工夫
mackee
0
1.2k
Go向けORM sqllaの紹介と JOINやUNIONを含んだクエリの扱い方
mackee
0
4.5k
デプロイ今昔物語 〜CGIからサーバーレスまで〜 / The deployment technics
mackee
10
12k
Other Decks in Programming
See All in Programming
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Security_for_introducing_eBPF
kentatada
0
110
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
260
Criando Commits Incríveis no Git
marcelgsantos
2
160
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
230
As an Engineers, let's build the CRM system via LINE Official Account 2.0
clonn
1
670
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
420
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
690
layerx_20241129.pdf
kyoheig3
2
280
PipeCDの歩き方
kuro_kurorrr
4
150
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
880
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
181
21k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Code Reviewing Like a Champion
maltzj
520
39k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Music & Morning Musume
bryan
46
6.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Building Adaptive Systems
keathley
38
2.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Transcript
͡Θ͡ΘͱPerl͔ΒGoʹ Ҡߦ͠Α͏ͱ͍ͯ͠Δ ԶͨͪͷϚΠΫϩαʔϏγʔζ YAPC::Japan::Online 2022 2022-03-05 Track B 13:40ʙ14:20 @macopy
a.k.a @mackee_w
͜ͷηογϣϯͷུ֓
1FSMೖֶࣜ͘ΜIUUQTQFSMFOUSBODFDPOOQBTTDPN 3FOÉF'SFODIIUUQTSFOFFGSFODICMPHTQPUDPN
(·ͩ)શ෦ஔ͖͍͑ͯͳ͍
None
Tonamelͷنײ -PCJ5PVSOBNFOU
ޙͷ5POBNFM ։ൃ։࢝ 5POBNFMʹ໊લ͕มߋ 1FSMͷߦߦ ͭͳ͗͜ΈͰएׯ૿Ճ 1FSMͷߦߦ (PϚΠΫϩαʔϏεº (Pͷߦߦ ͏ͪίʔυੜߦ
͜Ε·Ͱ2΄Ͳ͔͚ͯ ͡Θ͡ΘҠߦͭͭ͋͠Δ
ͦͷؒʹػೳ͕૿͑
େձ૿͍͑ͯ͘
͜ͷηογϣϯͰ ٞͷҰൠԽΛ͋͑ͯͤͣ TonamelͰͷࣄྫΛ͠·͢
ୈ1ষ: ͳͥϚΠΫϩαʔϏεʹ͢Δͷ͔ʁ ୈ2ষ: ॳΊͯͷαʔϏεׂ ୈ3ষ: ϚΠΫϩαʔϏεͨͪͷ࿈ܞํ๏
@macopy • ໘ന๏ਓΧϠοΫ eεϙʔπࣄۀ෦ TonamelαʔόαΠυςοΫϦʔυ • Perlେ͖ Go͖ • GGST༻Ωϟϥ:
ϥϜϨβϧ • ISUCON11 ༏উ ←NEW!
ୈ1ষ ͳͥϚΠΫϩαʔϏεʹ͢Δͷ͔ʁ
Ҡߦલͷߏ(ʙ2020-07) ͜ͷޙʹϚΠΫϩαʔϏεԽʹ߹ΘͤͯECSԽ
՝: PerlͰڊେGraphQLΛ ͘͞ͷՙ͕ॏ͍ • TonamelͰओͳAPIܗࣜͱͯ͠GraphQLΛ ࠾༻͍ͯ͠Δ • ڊେͳϨεϙϯεΛฦ͢ͱ͖ɺGraphQL.pm 0.47(2021-02ϦϦʔε)ҎલͰܕνΣοΫ ͕ϨεϙϯελΠϜͷ΄ͱΜͲΛΊ͍ͯͨ
• GraphQLΛ͍ଓ͚Δʹɺ͜ͷ͋ͨΓʹԿ Β͔ͷվળҊ͕ඞཁͩͬͨ
ݱࡏͷGraphQL.pm(>=0.47)σϑΥϧτͰ ࣮ߦ࣌ܕνΣοΫ͕Φϑʹͳ͍ͬͯΔ ࣌ʹͳ͍ͬͯͨGraphQL QueryͷϕϯνϚʔΫΛͬͯΈͨ(256ਓγϯάϧΤϦϛωʔγϣϯͷΫΤϦ) $ carton exec perl -Ilib tmp/graphql_benchmark.pl
bench 47bIg Benchmark: timing 10 iterations of default... default: 4 wallclock secs ( 3.22 usr + 0.08 sys = 3.30 CPU) @ 3.03/s (n=10) Rate default default 3.03/s — `local $ENV{PERL_STRICT} = 1;` ΛίʔυʹೖΕͯܕνΣοΫΛ༗ޮʹͯ͠ΈΔ(࣌͜ͷঢ়ଶͩͬͨ) $ carton exec perl -Ilib tmp/graphql_benchmark.pl bench 47bIg Benchmark: timing 10 iterations of default… default: 7 wallclock secs ( 6.57 usr + 0.07 sys = 6.64 CPU) @ 1.51/s (n=10) Rate default default 1.51/s --
͍͔ͭ͘ͷબࢶ • GraphQLΛ࠾༻͢Δ߹ • Perl ͷ··Ͱ GraphQL ΛߴԽ͢Δ • GraphQLΛίετΊʹฦͤΔϥΠϒϥϦ͕͋ΔݴޠʹΓ͑Δ
• ͦΕҎ֎Λ࠾༻͢Δ߹ • PerlͰѻ͑ΔൣғͷAPIతͳͷʹ͢Δ • XslateͰMPAʹΔ
GraphQLҎ֎ͷ՝: εέʔϦϯάੑ • ͕͋ΔτϥϑΟοΫͷରԠ • όοΫΤϯυDB͕Aurora MySQLͳͷͰɺखಈͰεέʔϧΞοϓ/Πϯ ͯ͠ෛՙʹରԠ͍ͯͨ͠ • =>
ӡ༻ͷख͕ؒ͠ΜͲ͍ͷͰɺࣗಈͰਫฏεέʔϧ͢Δσʔλε τΞʹҠߦ͍ͨ͠Ϟνϕʔγϣϯ • ྫ͑DynamoDBͱͳΔ͕ɺPerlͰDynamoDBΛѻ͏ϊϋ͕ͳ͍
ΠϕϯτʹΘΕΔαʔϏεͳͷͰ τϥϑΟοΫͷ͕େ͖͍
GraphQLҎ֎ͷ՝: ੩తܕ͕ͳ͍ݴޠ͕ਏ͍ • τʔφϝϯτදͷߏஙൺֱతෳࡶͳϓϩάϥϛϯάΛཁٻ͞ΕΔํ • εΠευϩʔͷOMW%, μϒϧΤϦϛͷഊऀαΠυͷஔͳͲ • ෳࡶͳϩδοΫΛΉͷʹܕ͕͋Δͱ”҆৺”͢Δ •
ͪΖΜςετඞཁ
ͱ͍͏Θ͚ͰGo͕͍͍ͨ • GraphQL => gqlgenͱ͍͏εΩʔϚϑΝʔετͰ੩తܕνΣοΫΛ ߦ͏ϥΠϒϥϦ • ਫฏεέʔϦϯάՄೳͳDBΛ͍͍ͨ => GoެࣜAWS
SDK͕͋ ΓɺDynamoDBΛѻ͏ͨΊͷϥούʔϥΠϒϥϦ͋Δ • ੩తܕ͕ͪΐ͏Ͳ͍͍ײ͡ʹଘࡏ͢Δ • ͳʹΑΓνʔϜϝϯόʔ͕աڈʹͬͨ͜ͱ͕͋ΔݴޠͰ͋Δ
Ͳ͏GoΛΈࠐΉ͔ʁ • શ෦Goʹ͢Δͱʁ • ࠓ·Ͱೖ͍ͬͯΔDBʹೖ͍ͬͯΔσʔλΛͲ͏͢Δͷ͔ • શ෦GoͰ࣮͠ऴΘΔ·Ͱ৽ن։ൃΛࢭΊΔͷ͔ • => ݁ߏ͍͠
• Ұ෦͚ͩGoʹ͍ͨ͠ • ͕ͩDBΛڞ༗ͨ͘͠ͳ͍ DynamoDBʹ͍ͨ͠
ϚΠΫϩαʔϏεׂ͢Δ
ҰൠతͳϚΠΫϩαʔϏεͷޮೳ • ݸʑͷΞϓϦέʔγϣϯͷΛখ͘͞อͯΔ • ΞδϦςΟ͕ߴ͘ͳΔ • ΞϓϦέʔγϣϯ͝ͱʹదͳΞʔΩςΫνϟΛબΔ • ؔ৺͝ͱʹνʔϜΛׂ͢Δ͜ͱ͕༰қʹͳΔ •
etc…
ϚΠΫϩαʔϏεΛΓ͔ͨͬͨͱ͍͏ΑΓ ͦΕҎ֎ͷྑ͍બࢶ͕ͳ͔ͬͨͷͰͬͨ • ϚΠΫϩαʔϏεΛબ͢Δͷʹ્͢Δཁૉ • νʔϜׂ͢Δ΄Ͳن͕େ͖͘ͳ͍ • ͚Ͳɺݱঢ়ͷΞʔΩςΫνϟͰղܾͰ͖ͳ͍՝͕͋Δ • ࠷ऴతʹϞδϡϥϞϊϦεʹ߹ମ͢ΔՄೳੑ͋Δͱࢥ͍ͬͯΔ
ͦͦϞδϡϥϞϊϦεͩͬͨͷͰ ׂ͔ͬͨ͢͠ • ઌਓ͕TonamelΛϞδϡϥϞ ϊϦεͰ࡞ͬͯ͘Ε͍ͯͨ • ׂ͢ΔͨΊͷػೳͷڥք͕ ͢Ͱʹଘࡏ͍ͯͨ͠
ͰͲ͏͍͔ͬͯ͘
ୈ2ষ ॳΊͯͷαʔϏεׂ
ॳखɺԿΛΓग़͔͢
͡ΊʹΓग़͢ͱྑ͍ͱ͞ΕΔαʔϏεͷ݅ • ͋ΔఔαʔϏε͕ʮڥք͚ͮΒΕͨίϯςΩετʯʹͦͬͯղ͞ Ε͍ͯΔલఏͰҎԼ • ଞͷίϯςΩετ͔Βͷґଘ͕গͳ͍ => ղ͍͢͠ • ϩʔϧόοΫ͕͍͢͠
=> ࡉ͔͘ϦϦʔεͰ͖Δ • ղʹΑΔརӹ͕େ͖͍
༏ઌॱҐ͚ݶ ʮϞϊϦε͔ΒϚΠΫϩαʔϏεʯΛࢀߟʹ
ͳͥτʔφϝϯτද͔ • GraphQLͷϨεϙϯελΠϜΛվળ͔ͨͬͨ͠ͷτʔφϝϯτද • => ղʹΑΔརӹ͕͋Δ • τʔφϝϯτදʹ͍ͭͯ৽ػೳ(μϒϧΤϦϛωʔγϣϯ)ͷ࣮͕༧ఆ͞Ε͍ͯͨ • =>
৽ػೳΛΔҰͱͯ͠ϚΠΫϩαʔϏεͷղ͕ߦ͑Δ • τʔφϝϯτද΄͔ͷαʔϏεʹґଘ͢ΔαʔϏεͳͷͰɺґଘ͞ΕΔଆͰ ͳ͍ • => ղͷ͢͠͞
্ͬͨͰ͜ͷஅͷৼΓฦΓ • ৽ػೳͷҰͱͯ͠ղΛߦ͏ͷ͋·ΓಘࡦͰͳ͍ • ϩʔϧόοΫ͕ͮ͠Β͘ͳΔ • ։ൃνʔϜ֎͔Βͷਐḿͷݟ͕ͨѱ͍ • ໌ࣔతʹػೳͷϚΠΫϩαʔϏεͷ࠶࣮Λ͍ͬͯΔͱ͍͏ ͷΛݴͬͨ΄͏͕ྑ͍
• ϦϦʔε͕ϏοάόϯʹͳΓ͕ͪ(͋Δఔ؇ࡦ͋Δ)
طଘͷϦΫΤετͱ ৽τʔφϝϯτදϦΫΤετͷ ͚ํ
GraphQLΤϯυϙΠϯτΛ͚Δ
ϢʔβʔใϔομʹJWTͰຒΊࠐΉ • ϞϊϦεͰड͚ͨϦΫΤετͷCookie͔ΒϦΫΤετϢʔβʔͷ ηογϣϯใΛऔΓग़͢ • ͜͜·Ͱैདྷ·Ͱ͋Δಈ࡞ • `X-Awesome-Authentication: <JWT>` ͷΑ͏ͳHTTPϔομʹJWTϊ
ܗͰೖΕΔ • ϓϩΩγͰBodyΛ͍ͬͨ͡ΓಡΜͩΓͨ͘͠ͳ͍
͞ΒʹύεΛ͚ͯ Ϣʔβ×େձͷݖݶใ༩
GraphQLͷύεΛେձ͝ͱʹ͚Δ ྫ: େձID=XXXXX ͷ߹ POST /new_awesome/graphql/XXXXX ͜ΕͰBodyΛಡ·ͳͯ͘ τʔφϝϯτදαʔϏε͕ΞΫηεϢʔβͷݖݶΛΕΔ
ͿͬͪΌ͚Δͱ͜Ε͓͢͢ΊͰͳ͍ • GraphQLΤϯυϙΠϯτ͕Ұݸʹ·ͱ·Δͷ͕͍͍ͱ͜ΖͷҰͭ • ΫϥΠΞϯταΠυෳݸʹ͔ΕΔͷରԠ͍ͯ͠ͳ͍͜ͱ͕ ଟ͍ • ͬͱ΄͔ʹΓํ͕͋ͬͨɺޙड़͢Δେ౷Ұʹ࣋ͪӽ͍ͯ͠Δ • ผղ:
ύʔεޙʹผͷAPIʹେձใ+ݖݶใ͍߹Θͤ + େձ αʔϏεΛઌʹ࡞Δ
ͰͲͷΑ͏ʹ ຊ൪ʹೖΕΔ͔
͓खܰʹαΠυΧʔʹͨ͠
αΠυΧʔʹ͢ΔϝϦοτɾσϝϦοτ • ϝϦοτ • Πϯϑϥ͕ෳࡶʹͳΒͳ͍, Ճ͢Δख͍ؒ҆ • εέʔϧΞτϞϊϦεͱҰॹʹ͢Δ => ෛՙ͕ಡΊͳ͍ͱ͖ʹศར
• σϝϦοτ • ECS Taskͷ10ίϯςφ੍ݶΛ͑Δ͜ͱग़དྷͳ͍ • αʔϏεͷधཁʹ߹ΘͤͯݸผʹεέʔϧΞτ͕ग़དྷͳ͍
ͯ͞ϦϦʔε… ͕ͩ💥Ϗοάόϯ💥Λආ͚͍ͨ
ϕετϓϥΫςΟε: 💥Ϗοάόϯ💥Λආ͚Δ • ͜ͷ߹ͷϏοάόϯͱ • ͍͖ͳΓ৽࣮ͨ͠ϚΠΫϩαʔϏεʹαʔϏεશମΛΓସ͑Δ • ϏοάόϯͷσϝϦοτ • Γ͕͠ࠔʹͳΔ
• ϦϦʔε୯Ґ͕େ͖͘ͳΔ => ݁ՌతʹσϦόϦʔ͕͘ͳΔ
τʔφϝϯτදαʔϏεͰߦͬͨ͜ͱ • Ұ෦ͷϢʔβʹݶఆػೳͱͯ͑͠ΔΑ ͏ʹఏڙ • ϑΟʔυόοΫΛΒ͍͍͢Ϣʔ βʹݶఆͯ͠ఏڙͰ͖Δ • େ͖ͳେձΛආ͚ͯఏڙ͢Δ •
چτʔφϝϯτදػೳฒߦͯ͠ఏڙ ͠ଓ͚Δ • ͕͋Εݹ͍ํΛͬͯΒ͏
β൛தʹߦͬͨ͜ͱ • ຊ൪ͰΤϥʔϩά͕ग़ͨΒ͙͢ʹ͢ • σʔλͿͬյΕܥ͍ʹগͳ͔ͬͨ(͋Δʹ͕͋ͬͨ) • ن͕େ͖ΊͷେձͰΘΕͯͨΒࢹ͍ͯ͠ΔϝτϦοΫΛݟΔ • DynamoDBΛॳΊ͍ͯͬͯͨͷͰෛՙ͕Θ͔Βͳ͔ͬͨͷ ͋Δ
• ༷ʑͯ͠େৎͦ͏ͳͷͰਖ਼ࣜϦϦʔε
͍Ζ͍Ζ͕͋ͬͨͨ͠ʂ
Ͱ͜Ε͚ͩͩͱͨͩͷ PolyglotߏͩΑͶ
ୈ3ষ ϚΠΫϩαʔϏε ͨͪͷ࿈ܞํ๏
τʔφϝϯτදαʔϏεҎ߱ͷ։ൃํ • GoΛؚΊͨpolyglotͰΕΔ͜ͱ͕Θ͔ͬͨͷͰҎԼͷํʹ͢Δ • ৽ػೳͯ͢ϚΠΫϩαʔϏεଆʹ࣮͢Δ • طଘػೳͷվमPerlϞϊϦεͷ࣮͕ۃʹૣ͍߹ͦͪΒ ʹ࣮͢Δɻͦ͏Ͱͳ͍߹ϚΠΫϩαʔϏεଆ
࣍ԿΛΓग़͢ͷ͔
༏ઌॱҐ͚ݶ
༏ઌॱҐ͚ݶ(Update൛)
εϙϯαʔػೳΛ࡞Δ͜ͱʹͳͬͨ
εϙϯαʔػೳͱ • େձϖʔδʹࠂΛࡌͤΒΕΔػೳ • ࠂओ࠵ஂମ͕ืूͯ͠ɺࠂ ओ͕ओ࠵ஂମʹ͓ۚΛ͏͜ͱͰࡌ ͤͯΒ͑Δ
ઃܭํ • εϙϯαʔαʔϏεͱܾࡁαʔϏεͷ2ͭʹׂ͢Δ • εϙϯαʔαʔϏεͷ => େձʹඥͮ͘εϙϯαʔͷཧ • ਃ༰ঝೝϑϩʔɺऔΓԼ͛ͳͲΛ͔ͭ͞ͲΔ •
εϙϯαʔ͕ԿΛͬͯਃ͞ΕΔ͔͋·Γؾʹ͠ͳ͍ • ܾࡁαʔϏε => StripeΛ༻͍ͨ͋Δਓ͔Β͋Δਓͷࢧ͍ͷཧ • Կͷࢧ͍͔ܾࡁαʔϏε͋·Γؾʹ͠ͳ͍
εϙϯαʔػೳͷσʔλͷྲྀΕ
͜͏ݴ͏ਤΛ࠷ॳʹॻ͘ͷ ͓͢͢Ίʂ
Domain Event • ৽τʔφϝϯτදαʔϏε࣮Ҏલ͔Β͋ΔඇಉظδϣϒΛҕৡ͢ΔͨΊ ͷػߏͱͯ͠Domain Eventͱݴ͏֓೦Λ༻ҙͨ͠ • ࣮ৄࡉతʹHTTPͰLambdaΛୟ͘ͱSQSʹΤϯΩϡʔ͞Εͯɺϝο ηʔδΛผͷLambda͕ىಈͯ͠ɺ֤ϚΠΫϩαʔϏεͷhandlerʹϝο ηʔδΛ৴͢Δ
• ϝοηʔδʮ◦◦͕ىͬͨ͜ʂʯͱ͍͏ײ͡Ͱpublish͞Ε͍ͯΔ • ʮ˓˓Λͯ͘͠Εʯͱ͍͏ײ͡Ͱͳ͍
େձ࡞࣌ͷϝοηʔδ৴ εϚʔτΤϯυϙΠϯτɾμϜύΠϓతͳࢥ
εϙϯαʔػೳͷͦͷଞ • σʔλετΞMySQL • τʔφϝϯτදαʔϏε΄ͲͷεέʔϧΞτੑೳ͍Βͳ͍ • ౿ΜͰͯࣾͰൺֱతѻ͑Δਓ͕ଟ͍MySQLΛ͏ • ΞʔΩςΫνϟActive Recordύλʔϯ
• τʔφϝϯτදαʔϏεClean Architecture
͜ΕͳΜͱ͔ϦϦʔεʂ
·ͱΊͱࠓޙͷల
ϚΠΫϩαʔϏεखஈͰ͋ΓతͰͳ͍ • TonamelʹͱͬͯϚΠΫϩαʔϏεҎԼͷ՝Λղܾ͢Δखஈ • ݱࡏͷαʔϏεΛࢭΊͣʹஞ࣍৽ػೳΛՃ͢Δ • ϞϊϦεଆͷ࠾༻ٕज़Ͱग़དྷͳ͔ͬͨ͜ͱΛॊೈʹಋೖ͢Δ • ࣌ظ͕དྷΕશ෦·ͨϞδϡϥϞϊϦε߹ମ͢Δͷݕ౼ •
νʔϜ͕ෳʹͳΔ͙Β͍େ͖͘ͳΔ͔Ͳ͏͔ • ࡞Δͷ͕ਖ਼͍͔͠Θ͔ΒΜॳظϞϊϦεͷ΄͏͕͍Ͱ͢ • ϞϊϦε͔ΒΓग़͢߹ɺਖ਼͘͠ಈ͘ͷ͕ͦ͜ʹ͋Δ͔Β࡞Δͷ͕ૣ͘ͳΔ
ࠓޙͷల • Apollo Federationͷಋೖ • PerlϞϊϦε, τʔφϝϯτද, εϙϯαʔ, ܾࡁͱͯ͢GraphQL ͕͔Ε͍ͯΔͷΛ౷߹͢ΔͨΊͷιϦϡʔγϣϯ
• ϞϊϦεʹ͋Δͯ͢ͷػೳΛϚΠΫϩαʔϏεׂ • ݱࡏҠ২࡞ۀதͷͷ͋Γ
Any Questions?
ࢀߟʹͨ͠ͷ • ʮϞϊϦε͔ΒϚΠΫϩαʔϏεʯSam Newman ஶ, ౡా ߒೋ ༁ • ͜ͷࢿྉΛ࡞Δࡍʹࢀরɻ͖ͬͯͨ͜ͱͷཧ͚આ໌ʹ༻͍
ͨɻ͜ͷຊͰΞϯνύλʔϯͱ͞Ε͍ͯΔ͜ͱɺTonamelͰ(ؾ ͔ͮͣʹ)ߦ͍ͬͯΔɻ
ิҨ ಠཱσϓϩΠՄೳੑ
ϚΠΫϩαʔϏεͰ͜Εͬͱ͍ͨ΄͏͕͍͍ ͧͬͯͭ • ʮϞϊϦε͔ΒϚΠΫϩαʔϏεʯͱ͍͏ຊʹॻ͔Ε͍ͯΔ ຊॻ͔ΒಘΒΕΔͷ͕͚ͭͩͩͱͨ͠Βɺ ͦΕʮϚΠΫϩαʔϏεʹಠཱσϓϩΠՄೳੑ ͷ֓೦Λ࣮֬ʹऔΓೖΕΑ͏ʯͱ͍͏͜ͱͩɻ
ಠཱσϓϩΠՄೳੑ 🤔
ಠཱσϓϩΠՄೳੑͱ • ʮ͋ΔϚΠΫϩαʔϏεʹର͢ΔมߋΛɺଞͷαʔϏεʹӨڹΛ༩͑ Δ͜ͱͳ͘ຊ൪ڥͰϓϩΠͰ͖Δͱݴ͏ߟ͑ํͩɻʯ • by ʮϞϊϦε͔ΒϚΠΫϩαʔϏεʯ • αʔϏεAΛมߋͨ͠ͱ͖ʹɺҰॹʹαʔϏεBมߋ͠ͳ͍ͱ͍͚ ͳ͍ʂͱ͍͏ͷಠཱ͍ͯ͠ͳ͍
• => ϚΠΫϩαʔϏεͰͳ͘”ࢄϞϊϦε”ͱ͍͏͜ͱʹ
ಠཱσϓϩΠՄೳੑͷద༻ • TonamelͰͦ͜·ͰશͳಠཱੑΛ୲อͰ͖͍ͯͳ͍ • τʔφϝϯτදαʔϏεPerlϞϊϦεͷαΠυΧʔલఏͷ࡞Γ • εϙϯαʔαʔϏεͱܾࡁαʔϏε΄ͱΜͲͷ௨৴͕Eventܦ༝ • ඇಉظΠϕϯτରԠ͢Δϋϯυϥʔ͕࣮͞Εͯͳ͚Εແࢹ͢ Δ͚ͩͳͷͰಠཱσϓϩΠՄೳੑ͕͋Δ
ಠཱσϓϩΠՄೳੑΛୡ͢ΔͨΊͷઓུ • αʔϏεؒͷґଘؔΛDAG(༗ඇ८ճάϥϑ)Ͱఆٛ • αʔϏεؒAPIʹඇޓ͕ൃੜ͢Δ߹ • ґଘ͞ΕΔଆޙํޓੑΛߟྀ͢Δ • deprecatedͳkeyΛҠߦظؒαϙʔτ͢ΔͳͲ •
ґଘ͢ΔଆޓੑΛߟྀͤͣ͏
αʔϏεؒґଘؔͷDAG
“جຊతʹ” ಉ࣌ʹߋ৽͕ඞཁͰ͋ͬͯ ґଘ͞ΕΔଆ͔ΒσϓϩΠ͢ΕOK σϓϩΠ͚Ε͍͍͚ΕͲݕূͳͲͷؔͰػೳ୯ҐͰσϓϩΠ͕ͪ͠
TonamelͷσϓϩΠϑϩʔ • લఏ: αʔόɾϑϩϯτΤϯυɾΠϯϑϥͯ͢ҰͭͷϨϙδτϦ (monorepo)Ͱཧ͍ͯ͠Δ • ϦϙδτϦ͕ࢄͯ͠ͳ͍ͷͰɺmasterϒϥϯνͰϩʔΧϧڥΛ ཱͯͨΒͦͷ··ຊ൪ՔಇͷαʔϏεͱΠίʔϧͷͷ͕ಘΒΕΔ • ͦΕͧΕͷαʔϏεಠཱͨ͠ECSαʔϏεσϓϩΠ͞ΕΔ
• σϓϩΠπʔϧkayac/ecspresso
monorepoͳͷͰ શ෦ͷαʔϏεΛͲʔΜͱΔͧʂ
ຖճશ෦ͷαʔϏεΛ σϓϩΠ͍ͯ͠Δͱ͍ʂ
ࢄϞϊϦεσϓϩΠ͕͘ͳΔ • σϓϩΠ͢Δͱ͖ʹͯ͢ͷαʔϏεΛ͋Δॱ൪ʹԊͬͯσϓϩΠ͠ ͳ͍ͱ͍͚ͳ͍ͱͳΔͱɺσϓϩΠʹඇৗʹ͕͔͔࣌ؒΔ • ϩʔϦϯάσϓϩΠͷ߹ Blue/Greenͷ߹ૣ͍͔ • σϓϩΠ͕͘ͳΔͱϩʔϧόοΫ͘ͳΔ͜ͱ͕ଟ͍͠ɺԿΑΓ ػೳͷσϦόϦʔʹ͕͔͔࣌ؒΓɺϦϦʔεϏοάόϯ͡Όͳ͍ͱ
͍ͬͨͳ͍Έ͍ͨʹͳͬͯྑ͘ͳ͍
େମͰಠཱσϓϩΠՄೳͳͷͰ ߋ৽͞ΕͨαʔϏε͚ͩͰϓϩΠͯ͠ ͋ͱσϓϩΠεΩοϓ͢Ε͍͍ͷ Ͱʁ
σϓϩΠεΩοϓઓུ • ECSʹ͏ίϯςφΠϝʔδͷߋ৽ΛɺʮαʔϏε͕ґଘ͢Δ repositoryͷಛఆͷσΟϨΫτϦ͕ߋ৽͞Ε͍ͯͨΒʯʹ͢Δ • ٖࣅతʹpolyrepoతͳcommit hashΛಘͯλάʹ͏ • ຊ൪ڥͱσϓϩΠ༧ఆͷcommit hashؒͰECS
Task Definitionͷࠩ ͕͋ΕσϓϩΠ͢Δ • ecspresso diff ΛͬͯdiffΛ֬ೝ
σϓϩΠͷ༷ࢠ