ScalaとPerlでMicroservices in production / Building microservices with Perl and Scala in production
by
aereal
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ScalaͱPerlͰ Microservices in production id:aereal @ Cookpad Tech Kitchen #11 feat. ͯͳ
Slide 2
Slide 2 text
ࣗݾհ • id:aereal • גࣜձࣾͯͳ (2012ʙ) • ͯͳϒοΫϚʔΫ • ͯͳϒϩά (ςοΫϦʔυ) • Perl, Ruby, Scala, Shell Script
Slide 3
Slide 3 text
ͯͳʹ͓͚ΔςοΫϦʔυɺ ͦͯ͠αʔϏεϓϥοτϑΥʔϜνʔϜͷ ςοΫϦʔυʹ͍ͭͯ http://developer.hatenastaff.com/entry/2017/09/28/110000
Slide 4
Slide 4 text
ΞδΣϯμ • Microserviceͱͯ͠࡞ͬͨ৽αʔϏεʹ͍ͭͯ • ຊ൪ೖͯ͠ͷ࠾ • Ψόφϯε • ڍ͍͛ͯͨ՝ղܾ͞Ε͔ͨ
Slide 5
Slide 5 text
৽αʔϏεʹ͍ͭͯ
Slide 6
Slide 6 text
http://hatenablog.com/
Slide 7
Slide 7 text
“ͯͳϒϩάΛͬͱຊ֨తʹ͍͍ͨํͷͨ Ίʹɺ༗ྉϓϥϯʮͯͳϒϩάProʯΛ༻ҙ͠ ͓ͯΓ·͢ɻࠂͷඇදࣔಠࣗυϝΠϯػೳ ͳͲɺͯͳϒϩάΛΑΓศརʹ͓͍͍ͨͩ ͚·͢ɻ” http://hatenablog.com/guide/pro
Slide 8
Slide 8 text
ͯͳϙΠϯτ ΫϨδοτΧʔυ ίϯϏχৼࠐ ۜߦৼࠐ ༻ https://www.hatena.ne.jp/shop/point/list
Slide 9
Slide 9 text
http://hatena.g.hatena.ne.jp/hatena/20150529/1432869070
Slide 10
Slide 10 text
վम or ࡞Γ͠ • چγεςϜϞϊϦγοΫ • ܾࡁͯͯ͠ͳϙΠϯτΛνϟʔδ͢Δ • ͯͳϙΠϯτΛͬͯߪೖ͢Δ • ༷Λཧ͢Δ͍͍ػձͰ͋Δ
Slide 11
Slide 11 text
ܾࡁߦαʔϏε (֎෦) ͯͳͷαʔϏε (ϒοΫϚʔΫͳͲ) ݱߦܾࡁγεςϜ ϙΠϯτཧ ڞ༗Ϟδϡʔϧ ༗ྉϓϥϯཧ ґଘ ͯͳͷαʔϏε ґଘ ͯͳͷαʔϏε ґଘ etc. ΞΧϯτ چܾࡁγεςϜͷߏ
Slide 12
Slide 12 text
چܾࡁγεςϜͷߏ • ܾࡁγεςϜ: WebΞϓϦέʔγϣϯ • APIͳ͘HTMLͷϑΥʔϜ͕͋ΔͷΈ • ڞ༗Ϟδϡʔϧ: ܾࡁߦαʔϏεͱ௨৴͢Δ࣮ • ͨ͘͞ΜͷϦϙδτϦ͔Βґଘ͞Ε͍ͯΔ • ڞ༗DBΛૢ࡞͢Δ
Slide 13
Slide 13 text
چܾࡁγεςϜͷվम? • ΄ͱΜͲݱ࣮తͰͳ͍ • ޓੑʹؔ͢ΔεΩʔϜ͕ͳ͍ • શޙํޓ or die • ෳͷυϝΠϯ͕ೖΓཚΕ͍ͯΔ • ݱࡏͷ༷ʹӨڹΛڧ͘ड͚Δ • վળ͕·ΘΒͳ͍
Slide 14
Slide 14 text
ϑϧεΫϥον
Slide 15
Slide 15 text
৽ܾࡁγεςϜ • ܾࡁߦαʔϏεͷήʔτΣΠͱͯ͠ಇ͘ • ͯͳϒϩάProͷ༩ͳͲ֤αʔϏεʹҠৡ • JSON over HTTPͳAPIͷΈΛఏڙ͢Δ • ରSSKDs (= small set of known developers)
Slide 16
Slide 16 text
৽ܾࡁγεςϜ ߏਤ ܾࡁߦαʔϏε (֎෦) ͯͳͷαʔϏε ༗ྉϓϥϯͷ ঢ়ଶཧ ৽ܾࡁγεςϜ UI API
Slide 17
Slide 17 text
http://staff.hatenablog.com/entry/2017/07/10/160000
Slide 18
Slide 18 text
ຊ൪ೖͯ͠ͷ࠾
Slide 19
Slide 19 text
ͦͷલʹৼΓฦΓ
Slide 20
Slide 20 text
ϚΠΫϩαʔϏεͰ࡞Δ͔ • 1ʙ3ষʹ͔͚ͯϝϦοτ ʮ༏ΕͨαʔϏεʯʹ͍ͭͯ ड़ΒΕ͍ͯΔ • ϚΠΫϩαʔϏεʹΑͬͯ αʔϏεΑΓΑ͘ͳΔͷ͔ • ΨόφϯεͳͲɺ ίετ͑ΔͩΖ͏͔ https://www.oreilly.co.jp/books/9784873117607/
Slide 21
Slide 21 text
ૄ݁߹ͱߴڽूੑ 1. ϞϊϦγοΫͰखΛೖΕͮΒ͍ (ີ݁߹) 2. ৽ͨʹ༗ྉϓϥϯΛಋೖ͍ͨ͠αʔϏε࠶࣮ 3. υϝΠϯ͕ࣝྲྀग़ (ڽूੑ) 4.
Slide 22
Slide 22 text
࣋ଓՄೳʹ࡞Γ (ͳ͓͠) ͍ͨ • είʔϓΛখ͘͞໌ྎʹอͭ • ૄ݁߹ (ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.1) • ߴڽूੑ (ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.2) • ׂ౷࣏͢Δ • ٕज़ҟ࣭ੑ • σϓϩΠͷϥΠϑαΠΫϧΛૣΊΔ
Slide 23
Slide 23 text
͏·͍ͬͨ͘? • Ψόφϯε͏·͍͔ͬͨ͘ • ૄ݁߹ʹͳ͔ͬͨ • ߴڽूʹͳ͔ͬͨ
Slide 24
Slide 24 text
Ψόφϯε: ̋ • ͯͳϒϩάͱ৽ܾࡁγεςϜΛ ڠௐͤͯ͞มߋ͢Δඞཁ͕͋Δ • → νʔϜΛϞϊϦγοΫʹ͢Δ͜ͱͰஅΛ͛ͨ • ଞνʔϜͱͷ࿈ܞ͓͓ΉͶى͖ͳ͔ͬͨ • ৽ܾࡁγεςϜͷϏδϣϯΛڞ༗͍ͯͨ͠ • → ͍͖ͳΓγεςϜ͕ૠ͛ସΘΔ͜ͱͳ͔ͬͨ
Slide 25
Slide 25 text
ϞϊϦγοΫͳνʔϜ • ͯͳϒϩάଆͷ։ൃͱ৽ܾࡁγεςϜͷ։ൃϝϯόʔΛ Ұகͤͨ͞ • (ॳɺͯͳϒϩάଆΛଞͷϝϯόʔʹ͓ئ͍͢Δ͜ͱ ݕ౼͍ͯͨ͠) • → ͕ࣝڽू͞ΕɺຊʹඞཁͳͷΛదʹ࡞Εͨ
Slide 26
Slide 26 text
ૄ݁߹: ̋ • UIͱAPIΛผͷݴޠͰ࣮͢Δ͜ͱͰஅ • UI = Perl, API = Scala • → چγεςϜͰͱͳͬͨڞ༗ΧʔωϧԽΛ͙ • ޓ͕ඞཁͳೝূΛUIʹཹΊΒΕͨ • → ݁Ռͱͯ͠UI͕APIʹର͢ΔഊࢭʹͳΔ
Slide 27
Slide 27 text
ߴڽूੑ: ˚ • UIͱAPIͷσϓϩΠλΠϛϯάΛἧ͑Δඞཁ͕͋Δ • → ͚ͩ͜͜ݟΔͱ࣌ظঘૣͩͬͨײ͋Δ • ʮ࠷ॳͷ30ؒແྉͰར༻Ͱ͖Δʯͱ͍͏ใɺ ͯͳϒϩάʹด͍ͯ͡ΔͷͰച্ूܭ͕͍͠ • → ϞσϦϯάదͩͬͨͱࢥ͏ͷͰɺ ूܭํ๏ͷվળͳͲͰΞϓϩʔν͍ͨ͠
Slide 28
Slide 28 text
࠾: 70 • ͋ͱ͔ΒϦΧόʔͮ͠Β͍ (ྫ: Ψόφϯε) ઌʹखΛଧͯͨ • Ұํɺٕज़తͳΞϓϩʔν (ྫ: σϓϩΠɺ౷߹ςετ) ·ͩ·ͩΕΔ͜ͱ͕͋Δ
Slide 29
Slide 29 text
·ͱΊ
Slide 30
Slide 30 text
MicroservicesԽΞϦ͔ • ৽ܾࡁγεςϜͰ࠾༻ͨ͠ͷਖ਼ղͩͬͨ • MicroservicesܥΛ࡞ΔͨΊͷσβΠϯ • = νʔϜ (ਓɺ৫) ·ͰϚΠΫϩʹׂ͢Δඞཁͳ͍ • ͦͷΘΓ͖ͪΜͱࢠΛඃΓͤͳ͍ͱ͍͚ͳ͍
Slide 31
Slide 31 text