Pro Yearly is on sale from $80 to $50! »

ScalaとPerlでMicroservices in production / Building microservices with Perl and Scala in production

3f4be9784f765877f444bc839de29888?s=47 aereal
September 28, 2017

ScalaとPerlでMicroservices in production / Building microservices with Perl and Scala in production

3f4be9784f765877f444bc839de29888?s=128

aereal

September 28, 2017
Tweet

Transcript

  1. ScalaͱPerlͰ
 Microservices in production id:aereal
 @ Cookpad Tech Kitchen #11

    feat. ͸ͯͳ
  2. ࣗݾ঺հ • id:aereal • גࣜձࣾ͸ͯͳ (2012ʙ) • ͸ͯͳϒοΫϚʔΫ • ͸ͯͳϒϩά

    (ςοΫϦʔυ) • Perl, Ruby, Scala, Shell Script
  3. ͸ͯͳʹ͓͚ΔςοΫϦʔυɺ
 ͦͯ͠αʔϏεϓϥοτϑΥʔϜνʔϜͷ ςοΫϦʔυʹ͍ͭͯ http://developer.hatenastaff.com/entry/2017/09/28/110000

  4. ΞδΣϯμ • Microserviceͱͯ͠࡞ͬͨ৽αʔϏεʹ͍ͭͯ • ຊ൪౤ೖͯ͠ͷ࠾఺ • Ψόφϯε • ڍ͍͛ͯͨ՝୊͸ղܾ͞Ε͔ͨ

  5. ৽αʔϏεʹ͍ͭͯ

  6. http://hatenablog.com/

  7. “͸ͯͳϒϩάΛ΋ͬͱຊ֨తʹ࢖͍͍ͨํͷͨ Ίʹɺ༗ྉϓϥϯʮ͸ͯͳϒϩάProʯΛ༻ҙ͠ ͓ͯΓ·͢ɻ޿ࠂͷඇදࣔ΍ಠࣗυϝΠϯػೳ ͳͲɺ͸ͯͳϒϩάΛΑΓศརʹ͓࢖͍͍ͨͩ ͚·͢ɻ” http://hatenablog.com/guide/pro

  8. ͸ͯͳϙΠϯτ ΫϨδοτΧʔυ ίϯϏχৼࠐ ۜߦৼࠐ ࢖༻ https://www.hatena.ne.jp/shop/point/list

  9. http://hatena.g.hatena.ne.jp/hatena/20150529/1432869070

  10. վम or ࡞Γ௚͠ • چγεςϜ͸ϞϊϦγοΫ • ܾࡁͯ͠͸ͯͳϙΠϯτΛνϟʔδ͢Δ • ͸ͯͳϙΠϯτΛ࢖ͬͯߪೖ͢Δ •

    ࢓༷Λ੔ཧ͢Δ͍͍ػձͰ΋͋Δ
  11. ܾࡁ୅ߦαʔϏε
 (֎෦) ͸ͯͳͷαʔϏε (ϒοΫϚʔΫͳͲ) ݱߦܾࡁγεςϜ ϙΠϯτ؅ཧ ڞ༗Ϟδϡʔϧ ༗ྉϓϥϯ؅ཧ ґଘ ͸ͯͳͷαʔϏε

    ґଘ ͸ͯͳͷαʔϏε ґଘ etc. ΞΧ΢ϯτ چܾࡁγεςϜͷߏ੒
  12. چܾࡁγεςϜͷߏ੒ • ܾࡁγεςϜ: WebΞϓϦέʔγϣϯ • API͸ͳ͘HTMLͷϑΥʔϜ͕͋ΔͷΈ • ڞ༗Ϟδϡʔϧ: ܾࡁ୅ߦαʔϏεͱ௨৴͢Δ࣮૷ •

    ͨ͘͞ΜͷϦϙδτϦ͔Βґଘ͞Ε͍ͯΔ • ڞ༗DBΛૢ࡞͢Δ
  13. چܾࡁγεςϜͷվम? • ΄ͱΜͲݱ࣮తͰ͸ͳ͍ • ޓ׵ੑʹؔ͢ΔεΩʔϜ͕ͳ͍ • ׬શޙํޓ׵ or die •

    ෳ਺ͷυϝΠϯ͕ೖΓཚΕ͍ͯΔ • ݱࡏͷ࢓༷ʹӨڹΛڧ͘ड͚Δ • վળ͕·ΘΒͳ͍
  14. ϑϧεΫϥον

  15. ৽ܾࡁγεςϜ • ܾࡁ୅ߦαʔϏεͷήʔτ΢ΣΠͱͯ͠ಇ͘ • ͸ͯͳϒϩάProͷ෇༩ͳͲ͸֤αʔϏεʹҠৡ • JSON over HTTPͳAPIͷΈΛఏڙ͢Δ •

    ର৅͸SSKDs (= small set of known developers)
  16. ৽ܾࡁγεςϜ
 ߏ੒ਤ ܾࡁ୅ߦαʔϏε
 (֎෦) ͸ͯͳͷαʔϏε ༗ྉϓϥϯͷ ঢ়ଶ؅ཧ ৽ܾࡁγεςϜ UI API

  17. http://staff.hatenablog.com/entry/2017/07/10/160000

  18. ຊ൪౤ೖͯ͠ͷ࠾఺

  19. ͦͷલʹৼΓฦΓ

  20. ϚΠΫϩαʔϏεͰ࡞Δ͔ • 1ʙ3ষʹ͔͚ͯϝϦοτ΍ ʮ༏ΕͨαʔϏεʯʹ͍ͭͯ ड़΂ΒΕ͍ͯΔ • ϚΠΫϩαʔϏεʹΑͬͯ
 αʔϏε͸ΑΓΑ͘ͳΔͷ͔ • ΨόφϯεͳͲɺ


    ίετ͸෷͑ΔͩΖ͏͔ https://www.oreilly.co.jp/books/9784873117607/
  21. ૄ݁߹ͱߴڽूੑ 1. ϞϊϦγοΫͰखΛೖΕͮΒ͍ (ີ݁߹) 2. ৽ͨʹ༗ྉϓϥϯΛಋೖ͍ͨ͠αʔϏε͸࠶࣮૷ 3. υϝΠϯ஌͕ࣝྲྀग़ (௿ڽूੑ) 4.

  22. ࣋ଓՄೳʹ࡞Γ (ͳ͓͠) ͍ͨ • είʔϓΛখ͘͞໌ྎʹอͭ • ૄ݁߹ (ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.1) • ߴڽूੑ

    (ʰϚΠΫϩαʔϏεΞʔΩςΫνϟʱ3.2.2) • ෼ׂ౷࣏͢Δ • ٕज़ҟ࣭ੑ • σϓϩΠͷϥΠϑαΠΫϧΛૣΊΔ
  23. ͏·͍ͬͨ͘? • Ψόφϯε͸͏·͍͔ͬͨ͘ • ૄ݁߹ʹͳ͔ͬͨ • ߴڽूʹͳ͔ͬͨ

  24. Ψόφϯε: ̋ • ͸ͯͳϒϩάͱ৽ܾࡁγεςϜΛ
 ڠௐͤͯ͞มߋ͢Δඞཁ͕͋Δ • → νʔϜΛϞϊϦγοΫʹ͢Δ͜ͱͰ෼அΛ๷͛ͨ • ଞνʔϜͱͷ࿈ܞ΋͓͓ΉͶ໰୊͸ى͖ͳ͔ͬͨ

    • ৽ܾࡁγεςϜͷϏδϣϯΛڞ༗͍ͯͨ͠ • → ͍͖ͳΓγεςϜ͕ૠ͛ସΘΔ͜ͱ͸ͳ͔ͬͨ
  25. ϞϊϦγοΫͳνʔϜ • ͸ͯͳϒϩάଆͷ։ൃͱ৽ܾࡁγεςϜͷ։ൃϝϯόʔΛ Ұகͤͨ͞ • (౰ॳɺ͸ͯͳϒϩάଆΛଞͷϝϯόʔʹ͓ئ͍͢Δ͜ͱ ΋ݕ౼͍ͯͨ͠) • → ஌͕ࣝڽू͞Εɺຊ౰ʹඞཁͳ΋ͷΛద੾ʹ࡞Εͨ

  26. ૄ݁߹: ̋ • UI૚ͱAPI૚ΛผͷݴޠͰ࣮૷͢Δ͜ͱͰ෼அ • UI૚ = Perl, API૚ =

    Scala • → چγεςϜͰ໰୊ͱͳͬͨڞ༗ΧʔωϧԽΛ๷͙ • ޓ׵͕ඞཁͳೝূΛUI૚ʹཹΊΒΕͨ • → ݁Ռͱͯ͠UI૚͕API૚ʹର͢Δ෗ഊ๷ࢭ૚ʹͳΔ
  27. ߴڽूੑ: ˚ • UI૚ͱAPI૚ͷσϓϩΠλΠϛϯάΛἧ͑Δඞཁ͕͋Δ • → ͚ͩ͜͜ݟΔͱ࣌ظঘૣͩͬͨײ͸͋Δ • ʮ࠷ॳͷ30೔ؒ͸ແྉͰར༻Ͱ͖Δʯͱ͍͏৘ใ͸ɺ
 ͸ͯͳϒϩάʹด͍ͯ͡ΔͷͰച্ूܭ͕΍΍೉͍͠

    • → ϞσϦϯά͸ద੾ͩͬͨͱࢥ͏ͷͰɺ
 ूܭํ๏ͷվળͳͲͰΞϓϩʔν͍ͨ͠
  28. ࠾఺: 70఺ • ͋ͱ͔ΒϦΧόʔͮ͠Β͍఺ (ྫ: Ψόφϯε) ͸
 ઌʹखΛଧͯͨ • Ұํɺٕज़తͳΞϓϩʔν

    (ྫ: σϓϩΠɺ౷߹ςετ) ͸ ·ͩ·ͩ΍ΕΔ͜ͱ͕͋Δ
  29. ·ͱΊ

  30. MicroservicesԽ͸ΞϦ͔ • ৽ܾࡁγεςϜͰ࠾༻ͨ͠ͷ͸ਖ਼ղͩͬͨ • Microservices͸ܥΛ࡞ΔͨΊͷσβΠϯ • = νʔϜ (ਓɺ૊৫) ·ͰϚΠΫϩʹ෼ׂ͢Δඞཁ͸ͳ͍

    • ͦͷ୅ΘΓ͖ͪΜͱ๧ࢠΛඃΓ௚ͤͳ͍ͱ͍͚ͳ͍
  31. ׬