Slide 1

Slide 1 text

͡Θ͡ΘͱPerl͔ΒGoʹ Ҡߦ͠Α͏ͱ͍ͯ͠Δ ԶͨͪͷϚΠΫϩαʔϏγʔζ YAPC::Japan::Online 2022 2022-03-05 Track B 13:40ʙ14:20 @macopy a.k.a @mackee_w

Slide 2

Slide 2 text

͜ͷηογϣϯͷུ֓

Slide 3

Slide 3 text

1FSMೖֶࣜ͘ΜIUUQTQFSMFOUSBODFDPOOQBTTDPN 3FOÉF'SFODIIUUQTSFOFFGSFODICMPHTQPUDPN

Slide 4

Slide 4 text

(·ͩ)શ෦͸ஔ͖׵͍͑ͯͳ͍

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Tonamelͷن໛ײ -PCJ5PVSOBNFOU ޙͷ5POBNFM ։ൃ։࢝ 5POBNFMʹ໊લ͕มߋ 1FSMͷߦ਺ߦ ͭͳ͗͜ΈͰएׯ૿Ճ 1FSMͷߦ਺ߦ (P੡ϚΠΫϩαʔϏεº (Pͷߦ਺ߦ ͏ͪίʔυੜ੒ߦ

Slide 7

Slide 7 text

͜Ε·Ͱ2೥΄Ͳ͔͚ͯ ͡Θ͡ΘҠߦͭͭ͋͠Δ

Slide 8

Slide 8 text

ͦͷؒʹ΋ػೳ͕૿͑

Slide 9

Slide 9 text

େձ΋૿͍͑ͯ͘

Slide 10

Slide 10 text

͜ͷηογϣϯͰ͸ ٞ࿦ͷҰൠԽΛ͋͑ͯͤͣ TonamelͰͷࣄྫΛ࿩͠·͢

Slide 11

Slide 11 text

ୈ1ষ: ͳͥϚΠΫϩαʔϏεʹ͢Δͷ͔ʁ ୈ2ষ: ॳΊͯͷαʔϏε෼ׂ ୈ3ষ: ϚΠΫϩαʔϏεͨͪͷ࿈ܞํ๏

Slide 12

Slide 12 text

@macopy • ໘ന๏ਓΧϠοΫ eεϙʔπࣄۀ෦ TonamelαʔόαΠυςοΫϦʔυ • Perlେ޷͖ Go΋޷͖ • GGST࢖༻Ωϟϥ: ϥϜϨβϧ • ISUCON11 ༏উ ←NEW!

Slide 13

Slide 13 text

ୈ1ষ ͳͥϚΠΫϩαʔϏεʹ͢Δͷ͔ʁ

Slide 14

Slide 14 text

Ҡߦલͷߏ੒(ʙ2020-07) ͜ͷ௚ޙʹϚΠΫϩαʔϏεԽʹ߹ΘͤͯECSԽ

Slide 15

Slide 15 text

՝୊: PerlͰڊେGraphQLΛ ͞͹͘ͷ͸ՙ͕ॏ͍ • TonamelͰ͸ओͳAPIܗࣜͱͯ͠GraphQLΛ ࠾༻͍ͯ͠Δ • ڊେͳϨεϙϯεΛฦ͢ͱ͖ɺGraphQL.pm 0.47(2021-02ϦϦʔε)ҎલͰ͸ܕνΣοΫ ͕ϨεϙϯελΠϜͷ΄ͱΜͲΛ઎Ί͍ͯͨ • GraphQLΛ࢖͍ଓ͚Δʹ͸ɺ͜ͷ͋ͨΓʹԿ Β͔ͷվળҊ͕ඞཁͩͬͨ

Slide 16

Slide 16 text

ݱࡏͷ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 --

Slide 17

Slide 17 text

͍͔ͭ͘ͷબ୒ࢶ • GraphQLΛ࠾༻͢Δ৔߹ • Perl ͷ··Ͱ GraphQL Λߴ଎Խ͢Δ • GraphQLΛίετ௿ΊʹฦͤΔϥΠϒϥϦ͕͋Δݴޠʹ৐Γ׵͑Δ • ͦΕҎ֎Λ࠾༻͢Δ৔߹ • PerlͰѻ͑ΔൣғͷAPIతͳ΋ͷʹ͢Δ • XslateͰMPAʹ໭Δ

Slide 18

Slide 18 text

GraphQLҎ֎ͷ՝୊: εέʔϦϯάੑ • ೾͕͋ΔτϥϑΟοΫ΁ͷରԠ • όοΫΤϯυDB͕Aurora MySQLͳͷͰɺखಈͰεέʔϧΞοϓ/Πϯ ͯ͠ෛՙʹରԠ͍ͯͨ͠ • => ӡ༻ͷख͕ؒ͠ΜͲ͍ͷͰɺࣗಈͰਫฏεέʔϧ͢Δσʔλε τΞʹҠߦ͍ͨ͠Ϟνϕʔγϣϯ • ྫ͑͹DynamoDBͱͳΔ͕ɺPerlͰDynamoDBΛѻ͏ϊ΢ϋ΢͕ͳ͍

Slide 19

Slide 19 text

Πϕϯτʹ࢖ΘΕΔαʔϏεͳͷͰ τϥϑΟοΫͷ೾͕େ͖͍

Slide 20

Slide 20 text

GraphQLҎ֎ͷ՝୊: ੩తܕ͕ͳ͍ݴޠ͕ਏ͍ • τʔφϝϯτදͷߏங͸ൺֱతෳࡶͳϓϩάϥϛϯάΛཁٻ͞ΕΔํ • εΠευϩʔͷOMW%, μϒϧΤϦϛͷഊऀαΠυͷ഑ஔͳͲ • ෳࡶͳϩδοΫΛ૊Ήͷʹܕ͕͋Δͱ”҆৺”͢Δ • ΋ͪΖΜςετ΋ඞཁ

Slide 21

Slide 21 text

ͱ͍͏Θ͚ͰGo͕࢖͍͍ͨ • GraphQL => gqlgenͱ͍͏εΩʔϚϑΝʔετͰ੩తܕνΣοΫΛ ߦ͏ϥΠϒϥϦ • ਫฏεέʔϦϯάՄೳͳDBΛ࢖͍͍ͨ => Go͸ެࣜAWS SDK͕͋ ΓɺDynamoDBΛѻ͏ͨΊͷϥούʔϥΠϒϥϦ΋͋Δ • ੩తܕ͕ͪΐ͏Ͳ͍͍ײ͡ʹଘࡏ͢Δ • ͳʹΑΓνʔϜϝϯόʔ͕աڈʹ࢖ͬͨ͜ͱ͕͋ΔݴޠͰ͋Δ

Slide 22

Slide 22 text

Ͳ͏GoΛ૊ΈࠐΉ͔ʁ • શ෦Goʹ͢Δͱʁ • ࠓ·Ͱೖ͍ͬͯΔDBʹೖ͍ͬͯΔσʔλΛͲ͏͢Δͷ͔ • શ෦GoͰ࣮૷͠ऴΘΔ·Ͱ৽ن։ൃΛࢭΊΔͷ͔ • => ݁ߏ೉͍͠ • Ұ෦͚ͩGoʹ͍ͨ͠ • ͕ͩDBΛڞ༗͸ͨ͘͠ͳ͍ DynamoDBʹ͍ͨ͠

Slide 23

Slide 23 text

ϚΠΫϩαʔϏε΁෼ׂ͢Δ

Slide 24

Slide 24 text

ҰൠతͳϚΠΫϩαʔϏεͷޮೳ • ݸʑͷΞϓϦέʔγϣϯͷ੹຿Λখ͘͞อͯΔ • ΞδϦςΟ͕ߴ͘ͳΔ • ΞϓϦέʔγϣϯ͝ͱʹద੾ͳΞʔΩςΫνϟΛબ΂Δ • ؔ৺͝ͱʹνʔϜΛ෼ׂ͢Δ͜ͱ͕༰қʹͳΔ • etc…

Slide 25

Slide 25 text

ϚΠΫϩαʔϏεΛ΍Γ͔ͨͬͨͱ͍͏ΑΓ ͦΕҎ֎ͷྑ͍બ୒ࢶ͕ͳ͔ͬͨͷͰ΍ͬͨ • ϚΠΫϩαʔϏεΛબ୒͢Δͷʹ્֐͢Δཁૉ • νʔϜ΋෼ׂ͢Δ΄Ͳن໛͕େ͖͘ͳ͍ • ͚Ͳɺݱঢ়ͷΞʔΩςΫνϟͰ͸ղܾͰ͖ͳ͍՝୊͕͋Δ • ࠷ऴతʹ͸ϞδϡϥϞϊϦεʹ߹ମ͢ΔՄೳੑ΋͋Δͱ͸ࢥ͍ͬͯΔ

Slide 26

Slide 26 text

ͦ΋ͦ΋ϞδϡϥϞϊϦεͩͬͨͷͰ ෼ׂ͠΍͔ͬͨ͢ • ઌਓ͕TonamelΛϞδϡϥϞ ϊϦεͰ࡞ͬͯ͘Ε͍ͯͨ • ෼ׂ͢ΔͨΊͷػೳͷڥք͕ ͢Ͱʹଘࡏ͍ͯͨ͠

Slide 27

Slide 27 text

Ͱ͸Ͳ͏΍͍͔ͬͯ͘

Slide 28

Slide 28 text

ୈ2ষ ॳΊͯͷαʔϏε෼ׂ

Slide 29

Slide 29 text

ॳखɺԿΛ੾Γग़͔͢

Slide 30

Slide 30 text

͸͡Ίʹ੾Γग़͢ͱྑ͍ͱ͞ΕΔαʔϏεͷ৚݅ • ͋Δఔ౓αʔϏε͕ʮڥք͚ͮΒΕͨίϯςΩετʯʹͦͬͯ෼ղ͞ Ε͍ͯΔલఏͰҎԼ • ଞͷίϯςΩετ͔Βͷґଘ͕গͳ͍ => ෼ղ͠΍͍͢ • ϩʔϧόοΫ͕͠΍͍͢ => ࡉ͔͘ϦϦʔεͰ͖Δ • ෼ղʹΑΔརӹ͕େ͖͍

Slide 31

Slide 31 text

༏ઌॱҐ෇͚৅ݶ ʮϞϊϦε͔ΒϚΠΫϩαʔϏε΁ʯΛࢀߟʹ

Slide 32

Slide 32 text

ͳͥτʔφϝϯτද͔ • GraphQLͷϨεϙϯελΠϜΛվળ͔ͨͬͨ͠ͷ͸τʔφϝϯτද • => ෼ղʹΑΔརӹ͕͋Δ • τʔφϝϯτදʹ͍ͭͯ৽ػೳ(μϒϧΤϦϛωʔγϣϯ)ͷ࣮૷͕༧ఆ͞Ε͍ͯͨ • => ৽ػೳΛ΍ΔҰ؀ͱͯ͠ϚΠΫϩαʔϏεͷ෼ղ͕ߦ͑Δ • τʔφϝϯτද͸΄͔ͷαʔϏεʹґଘ͢ΔαʔϏεͳͷͰɺґଘ͞ΕΔଆͰ͸ ͳ͍ • => ෼ղͷ͠΍͢͞

Slide 33

Slide 33 text

΍্ͬͨͰ͜ͷ൑அͷৼΓฦΓ • ৽ػೳͷҰ؀ͱͯ͠෼ղΛߦ͏ͷ͸͋·ΓಘࡦͰ͸ͳ͍ • ϩʔϧόοΫ͕ͮ͠Β͘ͳΔ • ։ൃνʔϜ֎͔Βͷਐḿͷݟͨ໨͕ѱ͍ • ໌ࣔతʹػೳͷϚΠΫϩαʔϏε΁ͷ࠶࣮૷Λ΍͍ͬͯΔͱ͍͏ ͷΛݴͬͨ΄͏͕ྑ͍ • ϦϦʔε͕ϏοάόϯʹͳΓ͕ͪ(͋Δఔ౓؇࿨ࡦ͸͋Δ)

Slide 34

Slide 34 text

طଘͷϦΫΤετͱ ৽τʔφϝϯτදϦΫΤετͷ ෼͚ํ

Slide 35

Slide 35 text

GraphQLΤϯυϙΠϯτΛ෼͚Δ

Slide 36

Slide 36 text

Ϣʔβʔ৘ใ͸ϔομʹJWTͰຒΊࠐΉ • ϞϊϦεͰड͚ͨϦΫΤετͷCookie͔ΒϦΫΤετϢʔβʔͷ ηογϣϯ৘ใΛऔΓग़͢ • ͜͜·Ͱ͸ैདྷ·Ͱ͋Δಈ࡞ • `X-Awesome-Authentication: ` ͷΑ͏ͳHTTPϔομʹJWTϊ ܗͰೖΕΔ • ϓϩΩγͰBodyΛ͍ͬͨ͡ΓಡΜͩΓ͸ͨ͘͠ͳ͍

Slide 37

Slide 37 text

͞ΒʹύεΛ෼͚ͯ Ϣʔβ×େձͷݖݶ৘ใ΋෇༩

Slide 38

Slide 38 text

GraphQLͷύεΛେձ͝ͱʹ෼͚Δ ྫ: େձID=XXXXX ͷ৔߹ POST /new_awesome/graphql/XXXXX ͜ΕͰBodyΛಡ·ͳͯ͘΋ τʔφϝϯτදαʔϏε͕ΞΫηεϢʔβͷݖݶΛ஌ΕΔ

Slide 39

Slide 39 text

ͿͬͪΌ͚Δͱ͜Ε͸͓͢͢ΊͰ͸ͳ͍ • GraphQL͸ΤϯυϙΠϯτ͕Ұݸʹ·ͱ·Δͷ͕͍͍ͱ͜ΖͷҰͭ • ΫϥΠΞϯταΠυ΋ෳ਺ݸʹ෼͔ΕΔͷ͸ରԠ͍ͯ͠ͳ͍͜ͱ͕ ଟ͍ • ΋ͬͱ΄͔ʹ΍Γํ͸͕͋ͬͨɺޙड़͢Δେ౷Ұʹ࣋ͪӽ͍ͯ͠Δ • ผղ: ύʔεޙʹผͷAPIʹେձ৘ใ+ݖݶ৘ใ໰͍߹Θͤ + େձ αʔϏεΛઌʹ࡞Δ

Slide 40

Slide 40 text

Ͱ͸ͲͷΑ͏ʹ ຊ൪ʹೖΕΔ͔

Slide 41

Slide 41 text

͓खܰʹαΠυΧʔʹͨ͠

Slide 42

Slide 42 text

αΠυΧʔʹ͢ΔϝϦοτɾσϝϦοτ • ϝϦοτ • Πϯϑϥ͕ෳࡶʹͳΒͳ͍, ௥Ճ͢Δखؒ΋͍҆ • εέʔϧΞ΢τ΋ϞϊϦεͱҰॹʹ͢Δ => ෛՙ͕ಡΊͳ͍ͱ͖ʹศར • σϝϦοτ • ECS Taskͷ10ίϯςφ੍ݶΛ௒͑Δ͜ͱ͸ग़དྷͳ͍ • αʔϏεͷधཁʹ߹ΘͤͯݸผʹεέʔϧΞ΢τ͕ग़དྷͳ͍

Slide 43

Slide 43 text

ͯ͞ϦϦʔε… ͕ͩ💥Ϗοάόϯ💥Λආ͚͍ͨ

Slide 44

Slide 44 text

ϕετϓϥΫςΟε: 💥Ϗοάόϯ💥Λආ͚Δ • ͜ͷ৔߹ͷϏοάόϯͱ͸ • ͍͖ͳΓ৽࣮૷ͨ͠ϚΠΫϩαʔϏεʹαʔϏεશମΛ੾Γସ͑Δ • ϏοάόϯͷσϝϦοτ • ੾Γ໭͕͠ࠔ೉ʹͳΔ • ϦϦʔε୯Ґ͕େ͖͘ͳΔ => ݁ՌతʹσϦόϦʔ͕஗͘ͳΔ

Slide 45

Slide 45 text

τʔφϝϯτදαʔϏεͰߦͬͨ͜ͱ • Ұ෦ͷϢʔβʹݶఆػೳͱͯ͠࢖͑ΔΑ ͏ʹఏڙ • ϑΟʔυόοΫΛ΋Β͍΍͍͢Ϣʔ βʹݶఆͯ͠ఏڙͰ͖Δ • େ͖ͳେձΛආ͚ͯఏڙ͢Δ • چτʔφϝϯτදػೳ΋ฒߦͯ͠ఏڙ ͠ଓ͚Δ • ໰୊͕͋Ε͹ݹ͍ํΛ࢖ͬͯ΋Β͏

Slide 46

Slide 46 text

β൛தʹߦͬͨ͜ͱ • ຊ൪ͰΤϥʔϩά͕ग़ͨΒ͙͢ʹ௚͢ • σʔλͿͬյΕܥ͸޾͍ʹ΋গͳ͔ͬͨ(͋Δʹ͸͕͋ͬͨ) • ن໛͕େ͖ΊͷେձͰ࢖ΘΕͯͨΒ؂ࢹ͍ͯ͠ΔϝτϦοΫΛݟΔ • DynamoDBΛॳΊͯ࢖͍ͬͯͨͷͰෛՙ܏޲͕Θ͔Βͳ͔ͬͨͷ΋ ͋Δ • ༷ʑ௚ͯ͠େৎ෉ͦ͏ͳͷͰਖ਼ࣜϦϦʔε΁

Slide 47

Slide 47 text

͍Ζ͍Ζ͕͋ͬͨ׬੒ͨ͠ʂ

Slide 48

Slide 48 text

Ͱ΋͜Ε͚ͩͩͱͨͩͷ Polyglotߏ੒ͩΑͶ

Slide 49

Slide 49 text

ୈ3ষ ϚΠΫϩαʔϏε ͨͪͷ࿈ܞํ๏

Slide 50

Slide 50 text

τʔφϝϯτදαʔϏεҎ߱ͷ։ൃํ਑ • GoΛؚΊͨpolyglotͰ΍ΕΔ͜ͱ͕Θ͔ͬͨͷͰҎԼͷํ਑ʹ͢Δ • ৽ػೳ͸͢΂ͯϚΠΫϩαʔϏεଆʹ࣮૷͢Δ • طଘػೳͷվम͸PerlϞϊϦε΁ͷ࣮૷͕ۃ୺ʹૣ͍৔߹͸ͦͪΒ ʹ࣮૷͢Δɻͦ͏Ͱͳ͍৔߹͸ϚΠΫϩαʔϏεଆ΁

Slide 51

Slide 51 text

࣍͸ԿΛ੾Γग़͢ͷ͔

Slide 52

Slide 52 text

༏ઌॱҐ෇͚৅ݶ

Slide 53

Slide 53 text

༏ઌॱҐ෇͚৅ݶ(Update൛)

Slide 54

Slide 54 text

εϙϯαʔػೳΛ࡞Δ͜ͱʹͳͬͨ

Slide 55

Slide 55 text

εϙϯαʔػೳͱ͸ • େձϖʔδʹ޿ࠂΛࡌͤΒΕΔػೳ • ޿ࠂ࿮͸ओ࠵ஂମ͕ืूͯ͠ɺ޿ࠂ ओ͕ओ࠵ஂମʹ͓ۚΛ෷͏͜ͱͰࡌ ͤͯ΋Β͑Δ

Slide 56

Slide 56 text

ઃܭํ਑ • εϙϯαʔαʔϏεͱܾࡁαʔϏεͷ2ͭʹ෼ׂ͢Δ • εϙϯαʔαʔϏεͷ੹຿ => େձʹඥͮ͘εϙϯαʔͷ؅ཧ • ਃ੥಺༰΍ঝೝϑϩʔɺऔΓԼ͛ͳͲΛ͔ͭ͞ͲΔ • εϙϯαʔ͕ԿΛ൐ͬͯਃ੥͞ΕΔ͔͸͋·Γؾʹ͠ͳ͍ • ܾࡁαʔϏε => StripeΛ༻͍ͨ͋Δਓ͔Β͋Δਓ΁ͷࢧ෷͍ͷ؅ཧ • Կͷࢧ෷͍͔͸ܾࡁαʔϏε͸͋·Γؾʹ͠ͳ͍

Slide 57

Slide 57 text

εϙϯαʔػೳͷσʔλͷྲྀΕ

Slide 58

Slide 58 text

͜͏ݴ͏ਤΛ࠷ॳʹॻ͘ͷ͸ ͓͢͢Ίʂ

Slide 59

Slide 59 text

Domain Event • ৽τʔφϝϯτදαʔϏε࣮૷Ҏલ͔Β͋ΔඇಉظδϣϒΛҕৡ͢ΔͨΊ ͷػߏͱͯ͠Domain Eventͱݴ͏֓೦Λ༻ҙͨ͠ • ࣮૷ৄࡉతʹ͸HTTPͰLambdaΛୟ͘ͱSQSʹΤϯΩϡʔ͞Εͯɺϝο ηʔδΛผͷLambda͕ىಈͯ͠ɺ֤ϚΠΫϩαʔϏεͷhandlerʹϝο ηʔδΛ഑৴͢Δ • ϝοηʔδ͸ʮ○○͕ىͬͨ͜ʂʯͱ͍͏ײ͡Ͱpublish͞Ε͍ͯΔ • ʮ˓˓Λͯ͘͠Εʯͱ͍͏ײ͡Ͱ͸ͳ͍

Slide 60

Slide 60 text

େձ࡞੒࣌ͷϝοηʔδ഑৴ εϚʔτΤϯυϙΠϯτɾμϜύΠϓతͳࢥ૝

Slide 61

Slide 61 text

εϙϯαʔػೳͷͦͷଞ • σʔλετΞ͸MySQL • τʔφϝϯτදαʔϏε΄ͲͷεέʔϧΞ΢τੑೳ͸͍Βͳ͍ • ৔਺౿ΜͰͯࣾ಺Ͱ΋ൺֱతѻ͑Δਓ͕ଟ͍MySQLΛ࢖͏ • ΞʔΩςΫνϟ͸Active Recordύλʔϯ • τʔφϝϯτදαʔϏε͸Clean Architecture

Slide 62

Slide 62 text

͜Ε΋ͳΜͱ͔ϦϦʔεʂ

Slide 63

Slide 63 text

·ͱΊͱࠓޙͷల๬

Slide 64

Slide 64 text

ϚΠΫϩαʔϏε͸खஈͰ͋Γ໨తͰ͸ͳ͍ • TonamelʹͱͬͯϚΠΫϩαʔϏε͸ҎԼͷ՝୊Λղܾ͢Δखஈ • ݱࡏͷαʔϏεΛࢭΊͣʹஞ࣍৽ػೳΛ௥Ճ͢Δ • ϞϊϦεଆͷ࠾༻ٕज़Ͱग़དྷͳ͔ͬͨ͜ͱΛॊೈʹಋೖ͢Δ • ࣌ظ͕དྷΕ͹શ෦·ͨϞδϡϥϞϊϦε΁߹ମ͢Δͷ΋ݕ౼ • νʔϜ͕ෳ਺ʹͳΔ͙Β͍େ͖͘ͳΔ͔Ͳ͏͔ • ࡞Δ΋ͷ͕ਖ਼͍͔͠Θ͔ΒΜॳظ͸ϞϊϦεͷ΄͏͕଎͍Ͱ͢ • ϞϊϦε͔Β੾Γग़͢৔߹ɺਖ਼͘͠ಈ͘΋ͷ͕ͦ͜ʹ͋Δ͔Β࡞Δͷ͕ૣ͘ͳΔ

Slide 65

Slide 65 text

ࠓޙͷల๬ • Apollo Federationͷಋೖ • PerlϞϊϦε, τʔφϝϯτද, εϙϯαʔ, ܾࡁͱ͢΂ͯGraphQL ͕෼͔Ε͍ͯΔͷΛ౷߹͢ΔͨΊͷιϦϡʔγϣϯ • ϞϊϦεʹ͋Δ͢΂ͯͷػೳΛϚΠΫϩαʔϏε΁෼ׂ • ݱࡏ΋Ҡ২࡞ۀதͷ΋ͷ͋Γ

Slide 66

Slide 66 text

Any Questions?

Slide 67

Slide 67 text

ࢀߟʹͨ͠΋ͷ • ʮϞϊϦε͔ΒϚΠΫϩαʔϏε΁ʯSam Newman ஶ, ౡా ߒೋ ༁ • ͜ͷࢿྉΛ࡞Δࡍʹࢀরɻ΍͖ͬͯͨ͜ͱͷཧ࿦෇͚΍આ໌ʹ༻͍ ͨɻ͜ͷຊͰΞϯνύλʔϯͱ͞Ε͍ͯΔ͜ͱ΋ɺTonamelͰ͸(ؾ ͔ͮͣʹ)ߦ͍ͬͯΔɻ

Slide 68

Slide 68 text

ิҨ ಠཱσϓϩΠՄೳੑ

Slide 69

Slide 69 text

ϚΠΫϩαʔϏεͰ͜Ε΍ͬͱ͍ͨ΄͏͕͍͍ ͧͬͯ΍ͭ • ʮϞϊϦε͔ΒϚΠΫϩαʔϏε΁ʯͱ͍͏ຊʹॻ͔Ε͍ͯΔ ຊॻ͔ΒಘΒΕΔ΋ͷ͕͚ͭͩͩͱͨ͠Βɺ ͦΕ͸ʮϚΠΫϩαʔϏεʹಠཱσϓϩΠՄೳੑ ͷ֓೦Λ࣮֬ʹऔΓೖΕΑ͏ʯͱ͍͏͜ͱͩɻ

Slide 70

Slide 70 text

ಠཱσϓϩΠՄೳੑ 🤔

Slide 71

Slide 71 text

ಠཱσϓϩΠՄೳੑͱ͸ • ʮ͋ΔϚΠΫϩαʔϏεʹର͢ΔมߋΛɺଞͷαʔϏεʹӨڹΛ༩͑ Δ͜ͱͳ͘ຊ൪؀ڥͰϓϩΠͰ͖Δͱݴ͏ߟ͑ํͩɻʯ • by ʮϞϊϦε͔ΒϚΠΫϩαʔϏε΁ʯ • αʔϏεAΛมߋͨ͠ͱ͖ʹɺҰॹʹαʔϏεB΋มߋ͠ͳ͍ͱ͍͚ ͳ͍ʂͱ͍͏ͷ͸ಠཱ͍ͯ͠ͳ͍ • => ϚΠΫϩαʔϏεͰ͸ͳ͘”෼ࢄϞϊϦε”ͱ͍͏͜ͱʹ

Slide 72

Slide 72 text

ಠཱσϓϩΠՄೳੑͷద༻ • TonamelͰ͸ͦ͜·Ͱ׬શͳಠཱੑΛ୲อͰ͖͍ͯͳ͍ • τʔφϝϯτදαʔϏε͸PerlϞϊϦεͷαΠυΧʔલఏͷ࡞Γ • εϙϯαʔαʔϏεͱܾࡁαʔϏε͸΄ͱΜͲͷ௨৴͕Eventܦ༝ • ඇಉظΠϕϯτ͸ରԠ͢Δϋϯυϥʔ͕࣮૷͞Εͯͳ͚Ε͹ແࢹ͢ Δ͚ͩͳͷͰಠཱσϓϩΠՄೳੑ͕͋Δ

Slide 73

Slide 73 text

ಠཱσϓϩΠՄೳੑΛୡ੒͢ΔͨΊͷઓུ • αʔϏεؒͷґଘؔ܎ΛDAG(༗޲ඇ८ճάϥϑ)Ͱఆٛ • αʔϏεؒAPIʹඇޓ׵͕ൃੜ͢Δ৔߹ • ґଘ͞ΕΔଆ͸ޙํޓ׵ੑΛߟྀ͢Δ • deprecatedͳkeyΛҠߦظؒ͸αϙʔτ͢ΔͳͲ • ґଘ͢Δଆ͸ޓ׵ੑΛߟྀͤͣ࢖͏

Slide 74

Slide 74 text

αʔϏεؒґଘؔ܎ͷDAG

Slide 75

Slide 75 text

“جຊతʹ͸” ಉ࣌ʹߋ৽͕ඞཁͰ͋ͬͯ΋ ґଘ͞ΕΔଆ͔ΒσϓϩΠ͢Ε͹OK σϓϩΠ෼͚Ε͹͍͍͚ΕͲݕূͳͲͷؔ܎Ͱػೳ୯ҐͰσϓϩΠ͕ͪ͠

Slide 76

Slide 76 text

TonamelͷσϓϩΠϑϩʔ • લఏ: αʔόɾϑϩϯτΤϯυɾΠϯϑϥ͢΂ͯҰͭͷϨϙδτϦ (monorepo)Ͱ؅ཧ͍ͯ͠Δ • ϦϙδτϦ͕෼ࢄͯ͠ͳ͍ͷͰɺmasterϒϥϯνͰϩʔΧϧ؀ڥΛ ཱͯͨΒͦͷ··ຊ൪ՔಇͷαʔϏεͱΠίʔϧͷ΋ͷ͕ಘΒΕΔ • ͦΕͧΕͷαʔϏε͸ಠཱͨ͠ECSαʔϏε΁σϓϩΠ͞ΕΔ • σϓϩΠπʔϧ͸kayac/ecspresso

Slide 77

Slide 77 text

monorepoͳͷͰ શ෦ͷαʔϏεΛͲʔΜͱ΍Δͧʂ

Slide 78

Slide 78 text

ຖճશ෦ͷαʔϏεΛ σϓϩΠ͍ͯ͠Δͱ஗͍ʂ

Slide 79

Slide 79 text

෼ࢄϞϊϦε͸σϓϩΠ͕஗͘ͳΔ • σϓϩΠ͢Δͱ͖ʹ͢΂ͯͷαʔϏεΛ͋Δॱ൪ʹԊͬͯσϓϩΠ͠ ͳ͍ͱ͍͚ͳ͍ͱͳΔͱɺσϓϩΠʹඇৗʹ͕͔͔࣌ؒΔ • ϩʔϦϯάσϓϩΠͷ৔߹ Blue/Greenͷ৔߹͸ૣ͍͔΋ • σϓϩΠ͕஗͘ͳΔͱϩʔϧόοΫ΋஗͘ͳΔ͜ͱ͕ଟ͍͠ɺԿΑΓ ػೳͷσϦόϦʔʹ͕͔͔࣌ؒΓɺϦϦʔε΋Ϗοάόϯ͡Όͳ͍ͱ ΋͍ͬͨͳ͍Έ͍ͨʹͳͬͯྑ͘ͳ͍

Slide 80

Slide 80 text

େମͰಠཱσϓϩΠՄೳͳͷͰ ߋ৽͞ΕͨαʔϏε͚ͩͰϓϩΠͯ͠ ͋ͱ͸σϓϩΠεΩοϓ͢Ε͹͍͍ͷ Ͱ͸ʁ

Slide 81

Slide 81 text

σϓϩΠεΩοϓઓུ • ECSʹ࢖͏ίϯςφΠϝʔδͷߋ৽ΛɺʮαʔϏε͕ґଘ͢Δ repository಺ͷಛఆͷσΟϨΫτϦ͕ߋ৽͞Ε͍ͯͨΒʯʹ͢Δ • ٖࣅతʹpolyrepoతͳcommit hashΛಘͯλάʹ࢖͏ • ຊ൪؀ڥͱσϓϩΠ༧ఆͷcommit hashؒͰECS Task Definitionͷࠩ ෼͕͋Ε͹σϓϩΠ͢Δ • ecspresso diff Λ࢖ͬͯdiffΛ֬ೝ

Slide 82

Slide 82 text

σϓϩΠͷ༷ࢠ